mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: test string literal indexing and mutable array filter
This commit is contained in:
parent
39245f088a
commit
4b029567e5
@ -497,6 +497,10 @@ fn test_filter() {
|
||||
println(arr.filter(it % 2 == 0 || it % 3 == 0))
|
||||
assert true
|
||||
assert [1,2,3].len == 3
|
||||
mut mut_arr := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
mut_arr = mut_arr.filter(it < 4)
|
||||
assert mut_arr.len == 3
|
||||
|
||||
// TODO
|
||||
//assert arr.filter(arr % 2).len == 5
|
||||
}
|
||||
|
@ -344,6 +344,8 @@ fn test_lower() {
|
||||
assert s.to_lower() == 'have a nice day!'
|
||||
s = 'hi'
|
||||
assert s.to_lower() == 'hi'
|
||||
assert 'aloha!'[0] == `a`
|
||||
assert 'aloha!'[5] == `!`
|
||||
}
|
||||
|
||||
fn test_upper() {
|
||||
|
Loading…
Reference in New Issue
Block a user