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

10 lines
238 B
V
Raw Normal View History

import toml
fn test_default_to() {
default_value := 4321
mut toml_txt := 'var = 1234'
toml_doc := toml.parse(toml_txt) or { panic(err) }
value := toml_doc.value('tar').default_to(default_value).int()
assert value == default_value
}