mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
15 lines
303 B
V
15 lines
303 B
V
import toml
|
|
|
|
struct TestStruct {
|
|
foo int
|
|
bar bool @[skip]
|
|
baz string = 'def' @[toml: barbaz]
|
|
}
|
|
|
|
fn test_toml_attr_encode() {
|
|
assert toml.encode(TestStruct{}) == 'foo = 0\nbarbaz = "def"'
|
|
}
|
|
|
|
fn test_toml_attr_decode() {
|
|
assert toml.decode[TestStruct]('foo = 0\nbarbaz = "def"')! == TestStruct{}
|
|
}
|