v2 / vlib / v / tests / generics / generic_map_alias_test.v
20 lines · 16 sloc · 335 bytes · 010a591de352890a21d3fd212883ad1c6b7124e7
Raw
1import x.json2
2
3pub struct AppJsonValue {
4pub:
5 file string
6 md5 string
7 creat i64
8}
9
10pub type AppJson = map[string]AppJsonValue
11
12fn test_main() {
13 app_json1 := map[string]AppJsonValue{}
14 res1 := json2.encode(app_json1)
15 assert '${res1}' == '{}'
16
17 app_json2 := AppJson{}
18 res2 := json2.encode(app_json2)
19 assert '${res2}' == '{}'
20}
21