Fix array.reverse() test
parent
b17df207f2
commit
0ca58aba5e
|
@ -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]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue