mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix multi_array prepend/insert (#7381)
This commit is contained in:
@ -1181,3 +1181,23 @@ fn test_voidptr_vbytes() {
|
||||
println(bytes)
|
||||
}
|
||||
}
|
||||
|
||||
fn test_multi_array_prepend() {
|
||||
mut a := [][]int{}
|
||||
a.prepend([1, 2, 3])
|
||||
assert a == [[1, 2, 3]]
|
||||
|
||||
mut b := [][]int{}
|
||||
b.prepend([[1, 2, 3]])
|
||||
assert b == [[1, 2, 3]]
|
||||
}
|
||||
|
||||
fn test_multi_array_insert() {
|
||||
mut a := [][]int{}
|
||||
a.insert(0, [1, 2, 3])
|
||||
assert a == [[1, 2, 3]]
|
||||
|
||||
mut b := [][]int{}
|
||||
b.insert(0, [[1, 2, 3]])
|
||||
assert b == [[1, 2, 3]]
|
||||
}
|
||||
|
Reference in New Issue
Block a user