test(spellcheck): a page with a line that is only a ruled stroke checks without crashing #63
Loading…
Reference in a new issue
No description provided.
Delete branch "test/ruled-only-page"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #61: fixes InkAlign.prepare crash on ruled-only lines.
On main
e1dfb68, checking spelling on a page where one line holds nothing but a ruled stroke (an underline on its own) crashed the check:InkAlign.prepare/3dropped the:rulestrokes, was left with an empty line andEnum.min([])raisedEnum.EmptyError(reached fromDocumentLive→InkMarks.marks→WordBoxes→InkAlign.align). #61 removed InkAlign, WordBoxes and InkMarks, so the crash is gone on main; this adds a regression test so it stays covered.DocumentLivetest, "checks a page with a line that's only a ruled stroke": a synthetic page (two lines of block-stroke "words" with a flat underline on its own line between them) and a transcription with one word more than the ink's gaps, with spellcheck on. It renders the hit list and the transcription underlines.e1dfb68with the same patch applied:Enum.EmptyErroratink_align.ex:295inprepare/3, test 0/1. Passes on main22e85cc.Lines.SVG(min_y/max_y/text_bottomuse defaults,item/1skips strokes with no points,simplify/1always keeps a point),Lines.Scene,Spellcheck.Words/LanguageToolandassets/js/hooks/spelling.js(checks the text matches and skips empty ranges). Nothing unguarded, so no code changes.mix precommit: 1021 passed, 1 excluded (live LanguageTool).Tests only; no UI change.