Fix array.reverse() test

pull/1216/head
joe-conigliaro 2019-07-18 02:35:40 +10:00 committed by Alexander Medvednikov
parent b17df207f2
commit 0ca58aba5e
1 changed files with 9 additions and 4 deletions

View File

@ -149,9 +149,14 @@ fn test_push_many() {
} }
fn test_reverse() { fn test_reverse() {
mut a := [1, 2, 3, 4] mut a := [1, 2, 3, 4]
mut b := ['test', 'array', 'reverse'] mut b := ['test', 'array', 'reverse']
c := a.reverse()
assert a.reverse() == [4, 3, 2, 1] d := b.reverse()
assert b.reverse() == ['reverse', 'array', 'test'] for i, _ in c {
assert c[i] == a[a.len-i-1]
}
for i, _ in d {
assert d[i] == b[b.len-i-1]
}
} }