mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
10 lines
238 B
V
10 lines
238 B
V
|
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
|
||
|
}
|