Skip to content

test: assert the existing language fixtures - #81

Open
lvolland wants to merge 1 commit into
speed-highlight:mainfrom
lvolland:test/language-fixtures
Open

test: assert the existing language fixtures#81
lvolland wants to merge 1 commit into
speed-highlight:mainfrom
lvolland:test/language-fixtures

Conversation

@lvolland

@lvolland lvolland commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

examples/languages/test.* is already the test suite — every fix since #53 adds a line to it. this doesn't add a corpus, it records what the tokenizer produces for yours.

paste this:

git checkout e2e036b~1 -- src/languages/js.js && npm test

today nothing happens. after: 3 red — test.js, test.md, test.ts. md and ts pull js in with a spread, so #70 broke them too. not visible by eye.

reverting each fix in turn, 6/6 go red on the right language: #53 py, #54 json, #56 md, #58 py, #66 ini, #70 js+md+ts.

no dependency, node --test is built in. nothing lands in src/ or dist/; the tarball stays at 263 files, +43 bytes for the "test" line. 0.2s.

notes

  • UPDATE=1 refreshes snapshots, but the "tokens must join back into the source" assert runs first — a refresh can't bless dropped code. with a token-dropping mutation it leaves 35/36 red and writes nothing.
  • snapshots freeze current behaviour, warts included — early UPDATE=1 diffs will show improvements that look like regressions.
  • .gitattributes pins fixtures and snapshots to -text — without it they check out CRLF on windows and the suite fails 36/36.
  • test.yml runs on prs and on push to main, since all six fixes were direct pushes. informational only: release.yml doesn't depend on it.
  • tokenisation only, not detect.js, terminal.js or the html output.
  • a process change, and nothing says you want one — close it if you'd rather not carry a tests/ dir, no hard feelings 🙂

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