diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index f90d415..87aa637 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -99,10 +99,11 @@ jobs: # output has to be captured into a variable. env: GOBIN: ${{ gitea.workspace }}/bin - run: go install github.com/toml-lang/toml-test/cmd/toml-test@v1.6.0 + run: go install github.com/toml-lang/toml-test/v2/cmd/toml-test@v2.2.0 - name: Build the decoder run: go build -o bin/interpres-decode ./cmd/interpres-decode - name: Compliance suite - run: bin/toml-test bin/interpres-decode + # interpres implements TOML 1.0; v2 tests 1.1 by default, so the mode is pinned. + run: bin/toml-test test -decoder=bin/interpres-decode -toml=1.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2cb00..b8309b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,8 +26,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `toml:"name,omitempty"` skips a nil or empty slice, array, or map. The decoder ignores both options. +### Changed + +- The compliance suite is [toml-test](https://github.com/toml-lang/toml-test) + v2.2.0, run in TOML 1.0 mode. The new corpus holds 205 valid and 474 invalid + cases (v1.6.0 had 185 and 371), and it caught the two documents the parser + still accepted, fixed below. + ### Fixed +- A float with an exponent marker but no digits (`1e`, `0.0E`) is rejected; + the exponent requires at least one digit. +- A date-time offset outside 00:00 through 23:59 is rejected; such offsets + were accepted and silently rolled over (`+00:60` decoded as `+01:00`). - Untagged embedded fields now decode symmetrically with encode: an embedded struct receives its keys inline (a nil embedded pointer struct is allocated), an embedded map catches the keys no field claims, and a name diff --git a/README.md b/README.md index 7d281c6..235a7bb 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ A TOML 1.0 parser and encoder for Go, written with the standard library alone. `interpres` (Latin for *interpreter*) gives zero-dependency programs an `encoding/json`-style API for reading and writing TOML, and passes the entire -official [toml-test](https://github.com/toml-lang/toml-test) suite: 185 valid -and 371 invalid cases, zero failures. +official [toml-test](https://github.com/toml-lang/toml-test) suite: 205 valid +and 474 invalid cases, zero failures. ## Features diff --git a/docs/CLI.md b/docs/CLI.md index c051f12..5b7218b 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -101,5 +101,5 @@ just toml-test ``` That recipe needs the `toml-test` binary on `PATH`, installed with -`go install github.com/toml-lang/toml-test/cmd/toml-test@v1.6.0`. The full +`go install github.com/toml-lang/toml-test/v2/cmd/toml-test@v2.2.0`. The full reference for the library itself is [API.md](API.md). diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index cbd7c46..6e74785 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -7,7 +7,7 @@ How to work on interpres. - Go 1.27.1, the version the `go` directive in `go.mod` declares. - [just](https://github.com/casey/just) for the recipes. - The `toml-test` binary on `PATH` for the compliance recipe, installed with - `go install github.com/toml-lang/toml-test/cmd/toml-test@v1.6.0`. + `go install github.com/toml-lang/toml-test/v2/cmd/toml-test@v2.2.0`. The module has no third-party dependencies, so there is nothing else to fetch. diff --git a/justfile b/justfile index f1019a0..4f4f91e 100644 --- a/justfile +++ b/justfile @@ -92,9 +92,9 @@ run: dev: go run -buildvcs=true {{package}} -# Runs the official toml-test compliance suite against the built adapter; toml-test must be on PATH (go install github.com/toml-lang/toml-test/cmd/toml-test@v1.6.0); not standard because no canonical recipe covers a domain compliance suite. +# Runs the official toml-test compliance suite against the built adapter; toml-test must be on PATH (go install github.com/toml-lang/toml-test/v2/cmd/toml-test@v2.2.0); not standard because no canonical recipe covers a domain compliance suite. toml-test: build - toml-test bin/interpres-decode + toml-test test -decoder=bin/interpres-decode -toml=1.0 # Coverage report as an HTML map from the gate's profile; not standard because the gate needs only the numeric floor, and a browser artefact is exploration, not a gate. coverage-html: test