pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.67k stars 208 forks source link

Add cmd/gotoml-test-encoder #907

Closed arp242 closed 8 months ago

arp242 commented 8 months ago

Since there was already an encoder I figured adding an encoder makes sense. Also had to fix it for local dates.

% toml-test -encoder ./gotoml-test-encoder
toml-test v2023-10-13 [./gotoml-test-encoder]: using embedded tests
encoder tests: 162 passed,  0 failed
arp242 commented 8 months ago

I copied all the extra tests from testdata/fuzz/FuzzUnmarshal to toml-test by the way: https://github.com/toml-lang/toml-test/commit/f03077ad42257217c30fb7969ee141a892f04a3b

Updating toml-test fails though, since it will also include the TOML 1.1 tests; you'll need to either use the tests/files-toml-1.0.0 file, or use toml-test -copy from the CLI.

pelletier commented 8 months ago

Thank you for taking care of this! I've created a follow-up issue to update toml-test properly.