array: test `arr << arr`

pull/3513/head
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
1 changed files with 10 additions and 0 deletions

View File

@ -536,3 +536,13 @@ fn test_bools() {
a << true a << true
println(a) 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]
}
}