v2 / vlib / v / tests / options / option_map_set_test.v
12 lines · 10 sloc · 220 bytes · eecaa64e9d82ea81ee2dcd8d4234440da7293400
Raw
1type Any = ?int | ?string
2
3struct TestConfig {
4 timeout ?int
5}
6
7fn 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