1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/toml/tests/inline_test.v

17 lines
307 B
V

import toml
struct Address {
street string
city string
}
fn test_inline() {
a := Address{'Elm Street', 'Springwood'}
mut mp := map[string]toml.Any{}
mp['street'] = toml.Any(a.street)
mp['city'] = toml.Any(a.city)
assert mp.to_inline_toml() == '{ street = "Elm Street", city = "Springwood" }'
}