v2 / vlib / v / tests / builtin_arrays / fixed_array_with_map_test.v
26 lines · 23 sloc · 346 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1module main
2
3struct File {
4 root string
5 path string
6}
7
8struct Test {
9mut:
10 mod_files map[string][5]File
11}
12
13fn test_main() {
14 mut test := Test{}
15 for i in 0 .. 4 {
16 test.mod_files['main'][i] = File{}
17 }
18 test.mod_files['main'][3] = File{
19 root: 'foo'
20 path: 'bar'
21 }
22 assert test.mod_files['main'][3] == File{
23 root: 'foo'
24 path: 'bar'
25 }
26}
27