v2 / vlib / json / tests / json_decode_arr_ref_test.v
10 lines · 8 sloc · 138 bytes · a66c4c9340042baa567b93cfd77e5fa096a847ba
Raw
1import json
2
3struct Test {
4 a string
5}
6
7fn test_main() {
8 x := json.decode([]&Test, '[{"a":"a"}]') or { exit(1) }
9 assert x[0].a == 'a'
10}
11