hex/tests/fixtures/hex-words
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 86d51c7bdf docs(hex-words): a phone's spelling-replacement that repeats an earlier one is a duplicate
The iPhone builder asked what happens when two terms in one file share a
spelling: on a phone both would become replacements with the same heard
words. The spec only covered a spelling against the file's own
replacements. Now: the earlier one wins (the file's own replacements come
first), and a later one is notApplied as duplicate. One new phone merge case.

Verified: the reference merger regenerates merge.json with only the new case
added (25 cases); read.json and write.json unchanged; markdownlint clean.
2026-11-24 18:30:30 -05:00
..
files docs(hex-words): pin refusal order and out-of-range numbers; clarify writer order and phone scope 2026-11-24 18:11:50 -05:00
hex-words.schema.json docs: define the Hex words file (.hexwords), version 1, with shared cases 2026-11-24 17:45:25 -05:00
merge.json docs(hex-words): a phone's spelling-replacement that repeats an earlier one is a duplicate 2026-11-24 18:30:30 -05:00
read.json docs(hex-words): pin refusal order and out-of-range numbers; clarify writer order and phone scope 2026-11-24 18:11:50 -05:00
README.md docs: define the Hex words file (.hexwords), version 1, with shared cases 2026-11-24 17:45:25 -05:00
write.json docs: define the Hex words file (.hexwords), version 1, with shared cases 2026-11-24 17:45:25 -05:00

Hex words file: shared cases

The cases every Hex reads, merges and writes .hexwords files against: the desktop app (Rust), Hex for iPhone and Hex for Android. The format is defined in docs/specs/hex-words.md. This folder only proves it.

  • read.json: one case per file in files/. Read its bytes (or, for generate, the base file followed by spaces up to padWithSpacesTo bytes) and compare the whole result to expect. Compare skipped as a set of {path, reason}. Where a case has skippedCounts instead, compare the number of skips per reason.
  • merge.json: merge(receiver, before, incoming, limits, parts, choices) against expect. receiver is desktop or phone, and limits overrides the receiver's own for that case. Undo after each case must give back before.
  • write.json: give the writer input, parse what it wrote, drop madeBy, and compare to expect.file. Compare expect.notExported as a set. The written bytes must also be UTF-8 without a byte order mark, pass hex-words.schema.json, and read back with nothing skipped.
  • hex-words.schema.json: JSON Schema 2020-12 for what a writer writes.

Some files here are broken on purpose: not UTF-8, UTF-16, 10,000 levels deep. Keep them byte for byte. Don't reformat them, and don't let an editor fix their encoding.

A change to the definition that changes an outcome changes these cases in the same pull request.