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

tests: add multi_dimensional array init tests

This commit is contained in:
yuyi 2020-06-03 20:10:29 +08:00 committed by GitHub
parent 439973004a
commit 13e09c61ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,4 +179,13 @@ fn test_multi_dimensional_array_init() {
c := [][]f64{len:2, init:[]f64{len:2, init:2.2}}
assert '$c' == '[[2.2, 2.2], [2.2, 2.2]]'
d := [][]int{len:3, init:[]int{len:2}}
assert '$d' == '[[0, 0], [0, 0], [0, 0]]'
e := [][]string{len:2, init:[]string{len:3}}
assert '$e' == "[['', '', ''], ['', '', '']]"
f := [][]int{len:3}
assert '$f' == '[[], [], []]'
}