v / vlib / toml / tests / quoted_keys_test.v
13 lines · 11 sloc · 322 bytes · 99be39cbd15d4bbb5ab14d2f870199908c00bc8d
Raw
1// vtest retry: 3
2import toml
3
4fn test_quoted_keys() {
5 str_value := 'V rocks!'
6 toml_txt := 'a."b.c" = "V rocks!"'
7 toml_doc := toml.parse_text(toml_txt) or { panic(err) }
8
9 value := toml_doc.value('a."b.c"')
10 assert value == toml.Any(str_value)
11 assert value as string == str_value
12 assert value.string() == str_value
13}
14