mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
make trim use cutset like trim_right/trim_left
This commit is contained in:

committed by
Alexander Medvednikov

parent
3db50f724b
commit
02fc7e14cd
@@ -302,6 +302,12 @@ fn test_hash() {
|
||||
assert s5.hash() % ((1 << 20) -1) == 592861
|
||||
}
|
||||
|
||||
fn test_trim() {
|
||||
assert 'banana'.trim('bna') == ''
|
||||
assert 'abc'.trim('ac') == 'b'
|
||||
assert 'aaabccc'.trim('ac') == 'b'
|
||||
}
|
||||
|
||||
fn test_trim_left() {
|
||||
mut s := 'module main'
|
||||
assert s.trim_left(' ') == 'module main'
|
||||
|
Reference in New Issue
Block a user