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:
parent
439973004a
commit
13e09c61ef
@ -179,4 +179,13 @@ fn test_multi_dimensional_array_init() {
|
|||||||
|
|
||||||
c := [][]f64{len:2, init:[]f64{len:2, init:2.2}}
|
c := [][]f64{len:2, init:[]f64{len:2, init:2.2}}
|
||||||
assert '$c' == '[[2.2, 2.2], [2.2, 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' == '[[], [], []]'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user