mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
builtin: add string.split_by_space() (#23651)
This commit is contained in:
parent
99a587af95
commit
4f85b35bb9
2 changed files with 19 additions and 0 deletions
|
@ -442,6 +442,13 @@ fn test_rsplit_once() ? {
|
|||
assert ext3 == ''
|
||||
}
|
||||
|
||||
fn test_split_by_space() {
|
||||
assert 'a b c'.split_by_space() == ['a', 'b', 'c']
|
||||
assert ' a\t\tb\tc'.split_by_space() == ['a', 'b', 'c']
|
||||
assert 'a b c \n\r'.split_by_space() == ['a', 'b', 'c']
|
||||
assert '\ta b \t \tc \r\n'.split_by_space() == ['a', 'b', 'c']
|
||||
}
|
||||
|
||||
fn test_is_bin() {
|
||||
assert ''.is_bin() == false
|
||||
assert '0b1'.is_bin() == true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue