1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Fix array.reverse() test

This commit is contained in:
joe-conigliaro 2019-07-18 02:35:40 +10:00 committed by Alexander Medvednikov
parent b17df207f2
commit 0ca58aba5e

View File

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