Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
nested_map_index_test.v
24
lines
·
22
sloc
·
253 bytes
·
612faac0f05824d56c466e1620d4e70d3a5f2168
Raw
1
struct
Foo {
2
mut
:
3
foo map[int]Bar
4
}
5
6
struct
Bar {
7
mut
:
8
bar map[int]string
9
}
10
11
fn
test_nested_map_index() {
12
f := Foo{
13
foo: {
14
11: Bar{
15
bar: {
16
22:
'hello'
17
}
18
}
19
}
20
}
21
ret := f.foo[11]!.bar[22]!
22
println(ret)
23
assert ret ==
'hello'
24
}
25