tests: add multi_dimensional array init tests

pull/5196/head
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
1 changed files with 9 additions and 0 deletions

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' == '[[], [], []]'
}