tests: test string literal indexing and mutable array filter
parent
39245f088a
commit
4b029567e5
|
@ -497,6 +497,10 @@ fn test_filter() {
|
||||||
println(arr.filter(it % 2 == 0 || it % 3 == 0))
|
println(arr.filter(it % 2 == 0 || it % 3 == 0))
|
||||||
assert true
|
assert true
|
||||||
assert [1,2,3].len == 3
|
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
|
// TODO
|
||||||
//assert arr.filter(arr % 2).len == 5
|
//assert arr.filter(arr % 2).len == 5
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,6 +344,8 @@ fn test_lower() {
|
||||||
assert s.to_lower() == 'have a nice day!'
|
assert s.to_lower() == 'have a nice day!'
|
||||||
s = 'hi'
|
s = 'hi'
|
||||||
assert s.to_lower() == 'hi'
|
assert s.to_lower() == 'hi'
|
||||||
|
assert 'aloha!'[0] == `a`
|
||||||
|
assert 'aloha!'[5] == `!`
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_upper() {
|
fn test_upper() {
|
||||||
|
|
Loading…
Reference in New Issue