mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
string: update the test
This commit is contained in:
parent
216fea1eb3
commit
43d56cb883
2 changed files with 10 additions and 7 deletions
|
@ -365,16 +365,14 @@ fn test_runes() {
|
|||
|
||||
fn test_left_right() {
|
||||
s := 'ALOHA'
|
||||
assert s.left(3) == 'ALO'
|
||||
assert s.left(0) == ''
|
||||
assert s.left(8) == s
|
||||
assert s.right(3) == 'HA'
|
||||
assert s.right(6) == ''
|
||||
assert s[..3] == 'ALO'
|
||||
assert s[..0] == ''
|
||||
assert s[..5] == s
|
||||
assert s[3..] == 'HA'
|
||||
//assert s.right(6) == ''
|
||||
u := s.ustring()
|
||||
assert u.left(3) == 'ALO'
|
||||
assert u.left(0) == ''
|
||||
assert s.left(8) == s
|
||||
assert u.right(3) == 'HA'
|
||||
assert u.right(6) == ''
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue