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:
parent
b17df207f2
commit
0ca58aba5e
@ -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]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user