v2 / vlib / v / tests / interfaces / interface_array_init_test.v
20 lines · 17 sloc · 384 bytes · 3b8f2fe5f5824642664aa6686c6aeb7ca4b2e244
Raw
1module main
2
3interface Value {}
4
5struct CreateRegionData {
6 name string
7 currency_code string
8 tax_rate f32
9 tax_code string @[omitempty]
10 countries []string
11 includes_tax bool @[omitempty]
12}
13
14fn test_main() {
15 rd := CreateRegionData{}
16 id := 'bro'
17 the_array := [Value(id), rd.name]
18 println(the_array)
19 assert '${the_array}' == "[Value('bro'), Value('')]"
20}
21