@@ -15,67 +15,59 @@ If you find something in your parser that's not exactly covered by toml-test
1515already then it should be added here; just creating an issue is enough: don't
1616* need* to create a PR.
1717
18- Compatible with TOML version [ v1.0.0] .
18+ Compatible with TOML versions [ v1.0.0 ] and [ v1.1 .0] .
1919
2020[ TOML ] : https://toml.io
2121[ v1.0.0 ] : https://toml.io/en/v1.0.0
22+ [ v1.1.0 ] : https://toml.io/en/v1.1.0
2223
2324Installation
2425------------
2526There are binaries on the [ release page] ; these are statically compiled and
26- should run in most environments. It's recommended you use a binary, or a tagged
27+ should run in most environments. It's recommended you use a binary or a tagged
2728release if you build from source especially in CI environments. This prevents
2829your tests from breaking on changes to tests in this tool.
2930
3031To compile from source you will need Go 1.19 or newer:
3132
32- % go install github.com/toml-lang/toml-test/cmd/toml-test@latest
33+ % go install github.com/toml-lang/toml-test/v2/ cmd/toml-test@latest
3334
3435This will build a ` toml-test ` binary in the ` ~/go/bin ` directory. You can change
3536that directory by setting ` GOBIN ` ; for example to use the current directory:
3637
37- % GOBIN="$(pwd)" go install github.com/toml-lang/toml-test/cmd/toml-test@latest
38+ % GOBIN="$(pwd)" go install github.com/toml-lang/toml-test/v2/ cmd/toml-test@latest
3839
39- [ release page ] : https://github.com/toml-lang/toml-test/releases
40-
41- Running in CI
42- -------------
43- The [ setup-toml-test] action can be used in GitHub. See the README for more
44- details.
40+ See [ CHANGELOG.md] for a list of changes.
4541
46- For other CI systems: the action essentially just downloads a release binary.
47- See index.js. Should be easy enough to reproduce elsewhere.
48-
49- [ setup-toml-test ] : https://github.com/toml-lang/setup-toml-test
42+ [ release page ] : https://github.com/toml-lang/toml-test/releases
43+ [ CHANGELOG.md ] : ./CHANGELOG.md
5044
5145Usage
5246-----
53- ` toml-test ` accepts an encoder or decoder as the first positional argument, for
54- example:
55-
56- % toml-test my-toml-decoder
57- % toml-test my-toml-encoder -encoder
58-
59- The ` -encoder ` flag is used to signal that this is an encoder rather than a
60- decoder.
61-
62- For example, to run the tests against the Go TOML library:
47+ ` toml-test test ` runs the test suite, and requires an ` -decoder ` and/or
48+ ` -encoder ` flag; for example:
6349
6450 # Install my parser
6551 % go install github.com/BurntSushi/toml/cmd/toml-test-decoder@master
6652 % go install github.com/BurntSushi/toml/cmd/toml-test-encoder@master
6753
68- % toml-test toml-test-decoder
69- toml-test v2023-10-23 [toml-test-decoder]: using embeded tests: 278 passed
54+ # Run tests
55+ % toml-test test \
56+ -decoder=toml-test-decoder \
57+ -encoder=toml-test-encoder
58+
59+ [..]
7060
71- % toml-test -encoder toml-test-encoder
72- toml-test v2023-10-23 [toml-test-encoder]: using embeded tests: 94 passed, 0 failed
61+ toml-test v2025-12-16 [toml-test-decoder] [toml-test-encoder]
62+ valid tests: 205 passed, 0 failed
63+ encoder tests: 205 passed, 0 failed
64+ invalid tests: 460 passed, 15 failed
7365
7466You can use ` -run [name] ` or ` -skip [name] ` to run or skip specific tests. Both
7567flags can be given more than once and accept glob patterns: `-run
7668'valid/string/* '`.
7769
78- See ` toml-test -help ` for detailed usage.
70+ See ` toml-test test -help ` for detailed usage.
7971
8072### Implementing a decoder
8173For your decoder to be compatible with ` toml-test ` it ** must** satisfy the
@@ -230,13 +222,13 @@ version of TOML; for example the 1.0.0 tests contain a test that trailing commas
230222in tables are invalid, but in 1.1.0 this should be considered valid.
231223
232224In short: you can't "just" copy all .toml and .json files from the tests/
233- directory. The easiest way to copy the correct files is to use ` - copy` :
225+ directory. The easiest way to copy the correct files is to use ` copy ` :
234226
235227 # Default of TOML 1.0
236- % toml-test - copy ./tests
228+ % toml-test copy ./tests
237229
238230 # Use TOML 1.1
239- % toml-test - copy ./tests -toml 1.1.0
231+ % toml-test copy -toml 1.1.0 ./tests
240232
241233Alternatively, the [ tests/files-toml-1.0.0] and [ tests/files-toml-1.1.0] files
242234contain a list of files you should run for that TOML version. You can use them
@@ -257,7 +249,7 @@ mentioned above, tests are split into two groups: invalid and valid tests.
257249
258250Invalid tests ** only check if a decoder rejects invalid TOML data** . Or, in the
259251case of testing encoders, invalid tests ** only check if an encoder rejects an
260- invalid representation of TOML** (e.g., a hetergeneous array). Therefore, all
252+ invalid representation of TOML** (e.g., a heterogeneous array). Therefore, all
261253invalid tests should try to ** test one thing and one thing only** . Invalid tests
262254should be named after the fault it is trying to expose. Invalid tests for
263255decoders are in the ` tests/invalid ` directory while invalid tests for encoders
0 commit comments