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

array: single element array test

This commit is contained in:
Alexander Medvednikov 2019-09-28 13:52:02 +03:00
parent 5348c667cc
commit 60eb73adb4

View File

@ -240,3 +240,12 @@ fn test_struct_print() {
assert b.str() == '{1 2}'
assert a.b.str() == '[{1 2}, {1 2}]'
}
fn test_single_element() {
mut a := [1]
a << 2
assert a.len == 2
assert a[0] == 1
assert a[1] == 2
println(a)
}