tests: test string literal indexing and mutable array filter

pull/4358/head
Alexander Medvednikov 2020-04-11 23:32:00 +02:00
parent 39245f088a
commit 4b029567e5
2 changed files with 6 additions and 0 deletions

View File

@ -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
}

View File

@ -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() {