Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
options
/
option_map_set_test.v
12
lines
·
10
sloc
·
220 bytes
·
eecaa64e9d82ea81ee2dcd8d4234440da7293400
Raw
1
type
Any = ?int | ?string
2
3
struct
TestConfig {
4
timeout ?int
5
}
6
7
fn
test_main() {
8
mut
r := TestConfig{}
9
mut
m := map[string]?Any{}
10
m[
'timeout'
] = r.timeout
11
assert m.str() ==
"{'timeout': Option(Any(Option(none)))}"
12
}
13