v2 / vlib / v / tests / structs / anon_struct_array_test.v
13 lines · 12 sloc · 223 bytes · 2dc0911e8c5880869110059639483c99431f9332
Raw
1module main
2
3fn test_main() {
4 tsts := [struct {
5 name: 'Vlang'
6 age: 20
7 }]
8 for tst in tsts {
9 assert '${tst}' == "struct {\n name: 'Vlang'\n age: 20\n}"
10 assert tst.age == 20
11 assert tst.name == 'Vlang'
12 }
13}
14