Skip to content

test: Check the output and input positions the specs expect - #45

Open
henrikottesorensen wants to merge 2 commits into
mainfrom
test/spec-output-positions
Open

henrikottesorensen wants to merge 2 commits into
mainfrom
test/spec-output-positions

Conversation

@henrikottesorensen

Copy link
Copy Markdown
Collaborator

Built on #44. Until #44 merges, this PR also shows its commit (128b26e); the change here is the top commit only.

Stops skipping the 5,071 spec entries that carry outputPos or inputPos: 5,067 in zh-tw-dictionary.yaml, 3 in zh-tw.yaml and 1 in en-us-g2.yaml. All of them pass.

What changed

  • Reader: outputPos and inputPos are parsed into the case. The backward leg of bothDirections swaps them along with input and expected, as lou_checkyaml.c:929-932 does.
  • Runner: a case that expects positions uses the position-aware Translate/BackTranslate overloads and compares the whole lists, as brl_checks.c does.
  • Units: the specs count widechars, which are code points on our UCS-4 build, while the wrapper reports UTF-16 indices. The runner maps the wrapper's arrays back to code points before comparing. This changes nothing for today's specs, which are all BMP, but it is what they mean. The separate-display-table path gets widechar positions straight from _lou_translate.
  • Tally: test option: outputPos (5070) and test option: inputPos (1) are gone.

Testing

On macOS arm64:

  • LibLouis.NET.Test passes 237/237, and the solution builds with -warnaserror.
  • A temporary bug that added 1 to every expected position failed exactly 5,071 cases, so every position entry is really compared.
  • Temporarily forcing every spec through the _lou_translate path still passed all 154, so the positions agree on both paths.

🤖 Generated with Claude Code

henrikottesorensen and others added 2 commits December 5, 2026 16:05
The eight dictionary harnesses are 60MB and 1,953,878 cases between
them, about two minutes against the spec suite's twenty seconds. They
all pass against 3.40.0, so leaving them out of LibLouis.NET.Test cost
the tables' word lists rather than hiding a failure, but nothing ran
them.

LibLouis.NET.DictionaryTest runs them. It reads them from the release
build/stage_tables.sh already downloads rather than from a committed
copy, so the repository does not grow by 60MB and they follow
LiblouisVersion with nothing to re-copy. They are listed one by one: a
wildcard on "dictionary" also matches nine ordinary specs
LibLouis.NET.Test already runs. The build fails, naming stage_tables.sh,
if they have not been staged, rather than discovering no tests.

The harness moves out of BrailleSpecTests into BrailleSpecRunner so both
projects compile the same one. The code moves unchanged.

CI runs them in a dictionary-test job on the same three operating
systems as test, beside it rather than after it, so pull requests wait
no longer and a failure among them is reported apart from the main
suite. publish waits for it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5,071 spec entries were dropped because they carry outputPos or
inputPos: 5,067 in zh-tw-dictionary.yaml, 3 in zh-tw.yaml and the one
in en-us-g2.yaml. Running them without the positions would only have
checked half of what each one asserts.

They are compared as lou_checkyaml compares them (brl_checks.c): the
whole list, outputPos one entry per input character and inputPos one
per output character. The backward leg of bothDirections swaps the two
along with input and expected (lou_checkyaml.c:929-932).

The specs count widechars, characters on the UCS-4 build, and the
wrapper reports UTF-16 indices, so the runner maps the wrapper's arrays
back to characters before comparing. That changes nothing for the
current specs, which are all BMP, but it is what they mean. The
separate-display-table path gets them from liblouis already in
widechars.

All 5,071 pass. Comparing against every expected position plus one
fails exactly those 5,071, so none of them passes unchecked, and
forcing every spec through _lou_translate gives the same positions.

The tally loses test option: outputPos (5070) and inputPos (1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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