mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
make trim use cutset like trim_right/trim_left
This commit is contained in:
parent
3db50f724b
commit
02fc7e14cd
5 changed files with 37 additions and 23 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue