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

json2: encode array (#17926)

This commit is contained in:
Hitalo Souza
2023-04-10 13:54:43 -03:00
committed by GitHub
parent 319ad5bae2
commit 91874f3244
3 changed files with 19 additions and 14 deletions

View File

@@ -200,6 +200,10 @@ fn test_option_array() {
val: false
}]
assert json.encode(StructTypeOption[[]StructType[bool]]{ val: array_of_struct }) == '{"val":[{"val":true},{"val":false}]}'
// assert json.encode(StructTypeOption[[][]int]{
// val: [[0, 1], [0, 2, 3], [2], [5, 1]]
// }) == '{"val":[[0,1],[0,2,3],[2],[5,1]]}'
}
fn test_alias() {