v2 / vlib / x / json2 / tests / decode_array_array_test.v
16 lines · 13 sloc · 267 bytes · cafb69dee2a4969973c911f4a6ffff6243257f3b
Raw
1module main
2
3import json
4import x.json2
5
6pub struct Data {
7 name string
8 data [][]f64
9}
10
11fn test_main() {
12 json_data := '{"name":"test","data":[[1,2,3],[4,5,6]]}'
13 info := json.decode(Data, json_data)!
14 info2 := json2.decode[Data](json_data)!
15 assert info == info2
16}
17