feat(cmd): add the encoder mode to the toml-test adapter
Test / test (push) Successful in 1m33s

Assisted-by: DeepSeek V4.1 Flash
This commit is contained in:
2026-09-19 11:38:19 +02:00
parent 0149a5b4d1
commit bccaf087c8
10 changed files with 418 additions and 30 deletions
+4 -4
View File
@@ -7,9 +7,9 @@ source tree; nothing is aspirational.
interpres is one public library package, one command, and one example. The
library implements the whole of TOML 1.1, decoding and encoding, in the
standard library alone; the command wraps the parser for the toml-test
compliance harness, against which it stands at 214 valid and 467 invalid cases
with zero failures; the example demonstrates the API.
standard library alone; the command wraps the parser and the encoder for the
toml-test compliance harness, against which it stands at 214 valid, 467 invalid
and 214 encoder cases with zero failures; the example demonstrates the API.
```mermaid
flowchart TD
@@ -36,7 +36,7 @@ strict validation.
| Path | Responsibility |
|---|---|
| `.` (package `interpres`) | The whole library. `interpres.go` declares the exported surface (`Parse`, `Unmarshal`, `Marshal`, the `*Context` variants, `Decoder`, `Encoder`, `Marshaler`, `Unmarshaler`, `SyntaxError`, the local date-time types); everything below it is unexported. |
| `cmd/interpres-decode` | The toml-test adapter. Reads TOML on stdin, writes tagged JSON on stdout. Owns no parsing logic. |
| `cmd/interpres-decode` | The toml-test adapter, both directions. Reads TOML on stdin, writes tagged JSON on stdout; with `-encode` it reads tagged JSON and writes TOML. Owns no parsing logic and no emission logic. |
| `examples/basic` | A runnable tour of the API. Documentation in executable form, not part of the library. |
Inside the library package, one file owns one concern: