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:
parent
5348c667cc
commit
60eb73adb4
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user