Skip to content

test: run the conformance corpus from Tish, the third target - #12

Merged
spacedevin merged 1 commit into
mainfrom
test/tish-runs-conformance
Aug 4, 2026
Merged

test: run the conformance corpus from Tish, the third target#12
spacedevin merged 1 commit into
mainfrom
test/tish-runs-conformance

Conversation

@spacedevin

Copy link
Copy Markdown
Owner

The corpus exists to make "one source, three targets" a fact rather than a claim. It was only ever run by two of them — the JS build and the Rust crate. The Tish source itself, which both are generated from, was never checked against it.

That's the leg that mattered most: a change altering the Tish semantics but surviving both emits would have gone unnoticed by the very thing meant to catch it.

test/conformance.tish imports ../src/index.tish and runs the same inputs against the same expected files.

CONFORMANCE_OK        — 11 cases   (JS)
CONFORMANCE_OK (tish) — 11 cases   (Tish)
cargo test            — 4 passed   (Rust)

Two things it does differently

Runs under tish run, not the JS build. Reading the corpus needs tish:fs, and the JS target has no filesystem — readDir isn't defined there under any feature flag.

Compares semantically, not textually. This runtime's JSON.stringify ignores its indent argument and emits compact output, so comparing against the pretty-printed expected files failed all 11 cases on whitespace while the data matched exactly. Re-stringifying the parsed expectation puts both sides in one form; key order survives the round-trip, so real drift is still caught.

Wired into npm test and CI as its own step.

The corpus exists to make "one source, three targets" a fact rather than a
claim, and it was only ever run by two of them: the JS build and the Rust crate.
The Tish source itself — what both are generated FROM — was never checked
against it. A change that altered the Tish semantics but survived both emits
would have gone unnoticed by the very thing meant to catch it.

test/conformance.tish imports ../src/index.tish and runs the same inputs against
the same expected files. All 11 cases pass, so the three targets are now
demonstrably in agreement rather than assumed to be.

Two things it has to do differently, both noted where they happen:

Run under `tish run` instead of the JS build, because reading the corpus needs
`tish:fs` and the JS target has no filesystem at all.

Compare semantically rather than textually. This runtime's JSON.stringify
ignores its indent argument and emits compact output, so comparing against the
pretty-printed expected file failed on whitespace for all 11 cases while the
data matched exactly. Re-stringifying the parsed expectation puts both sides in
one form; key order survives the round-trip, so real drift is still caught.
@spacedevin
spacedevin merged commit 934ff56 into main Aug 4, 2026
5 checks passed
@spacedevin
spacedevin deleted the test/tish-runs-conformance branch August 4, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant