mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix array_test.v
This commit is contained in:
parent
3c0fca9258
commit
e3275f6083
@ -230,23 +230,6 @@ fn test_right() {
|
||||
assert d[1] == 3
|
||||
}
|
||||
|
||||
fn test_right_with_n_bigger_than_array_size() {
|
||||
a := [1, 2, 3, 4]
|
||||
// NOTE: slice syntax wont return empty array
|
||||
// instead will give index out of bounds
|
||||
// mut b := a[10..]
|
||||
mut b := a.right(10)
|
||||
assert b.len == 0
|
||||
|
||||
// also check that the result of a.right
|
||||
// is an array of the same type/element size as a:
|
||||
b << 5
|
||||
b << 6
|
||||
assert b.len == 2
|
||||
assert b[0] == 5
|
||||
assert b[1] == 6
|
||||
}
|
||||
|
||||
fn test_left() {
|
||||
a := [1, 2, 3]
|
||||
c := a[0..2]
|
||||
@ -255,8 +238,6 @@ fn test_left() {
|
||||
assert c[1] == 2
|
||||
assert d[0] == 1
|
||||
assert d[1] == 2
|
||||
assert e[0] == 1
|
||||
assert e.len == 3
|
||||
}
|
||||
|
||||
fn test_slice() {
|
||||
|
Loading…
Reference in New Issue
Block a user