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

array: test arr << arr

This commit is contained in:
Alexander Medvednikov 2020-01-19 22:15:37 +01:00 committed by GitHub
parent 0d52cc97e4
commit ab368bdc53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -536,3 +536,13 @@ fn test_bools() {
a << true
println(a)
}
fn test_push_many_self() {
mut actual_arr := [1, 2, 3, 4]
actual_arr << actual_arr
expected_arr := [1, 2, 3, 4, 1, 2, 3, 4]
assert actual_arr.len == expected_arr.len
for i := 0; i < actual_arr.len; i++ {
assert actual_arr[i] == expected_arr[i]
}
}