| 1 | import toml |
| 2 | |
| 3 | struct TestStruct { |
| 4 | foo int |
| 5 | bar bool @[skip] |
| 6 | baz string = 'def' @[toml: barbaz] |
| 7 | } |
| 8 | |
| 9 | fn test_toml_attr_encode() { |
| 10 | assert toml.encode(TestStruct{}) == 'foo = 0\nbarbaz = "def"' |
| 11 | } |
| 12 | |
| 13 | fn test_toml_attr_decode() { |
| 14 | assert toml.decode[TestStruct]('foo = 0\nbarbaz = "def"')! == TestStruct{} |
| 15 | } |
| 16 |