array: single element array test
parent
5348c667cc
commit
60eb73adb4
|
@ -240,3 +240,12 @@ fn test_struct_print() {
|
||||||
assert b.str() == '{1 2}'
|
assert b.str() == '{1 2}'
|
||||||
assert a.b.str() == '[{1 2}, {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