build: upgrade the compliance suite to toml-test v2.2.0
Test / test (push) Successful in 1m42s

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-17 21:30:41 +02:00
parent 3cd538fad6
commit 18f1cd51e9
6 changed files with 20 additions and 8 deletions
+3 -2
View File
@@ -99,10 +99,11 @@ jobs:
# output has to be captured into a variable. # output has to be captured into a variable.
env: env:
GOBIN: ${{ gitea.workspace }}/bin 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 - name: Build the decoder
run: go build -o bin/interpres-decode ./cmd/interpres-decode run: go build -o bin/interpres-decode ./cmd/interpres-decode
- name: Compliance suite - 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
+11
View File
@@ -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 `toml:"name,omitempty"` skips a nil or empty slice, array, or map. The
decoder ignores both options. 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 ### 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 - Untagged embedded fields now decode symmetrically with encode: an embedded
struct receives its keys inline (a nil embedded pointer struct is struct receives its keys inline (a nil embedded pointer struct is
allocated), an embedded map catches the keys no field claims, and a name allocated), an embedded map catches the keys no field claims, and a name
+2 -2
View File
@@ -3,8 +3,8 @@
A TOML 1.0 parser and encoder for Go, written with the standard library alone. A TOML 1.0 parser and encoder for Go, written with the standard library alone.
`interpres` (Latin for *interpreter*) gives zero-dependency programs an `interpres` (Latin for *interpreter*) gives zero-dependency programs an
`encoding/json`-style API for reading and writing TOML, and passes the entire `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 official [toml-test](https://github.com/toml-lang/toml-test) suite: 205 valid
and 371 invalid cases, zero failures. and 474 invalid cases, zero failures.
## Features ## Features
+1 -1
View File
@@ -101,5 +101,5 @@ just toml-test
``` ```
That recipe needs the `toml-test` binary on `PATH`, installed with 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). reference for the library itself is [API.md](API.md).
+1 -1
View File
@@ -7,7 +7,7 @@ How to work on interpres.
- Go 1.27.1, the version the `go` directive in `go.mod` declares. - Go 1.27.1, the version the `go` directive in `go.mod` declares.
- [just](https://github.com/casey/just) for the recipes. - [just](https://github.com/casey/just) for the recipes.
- The `toml-test` binary on `PATH` for the compliance recipe, installed with - 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. The module has no third-party dependencies, so there is nothing else to fetch.
+2 -2
View File
@@ -92,9 +92,9 @@ run:
dev: dev:
go run -buildvcs=true {{package}} 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: 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 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 coverage-html: test