Debian Codegraph @

tests/yaml/issue-1863-basechar-finalize.yaml

raw symbols SCIP
1 # Regression test for https://github.com/liblouis/liblouis/issues/1863
2 #
3 # A basechar chain (A→B→a) where the hash iteration order causes a
4 # character to be visited after it was already recursively finalized
5 # used to result in a cycle in the linked list, making
6 # isEmphasizable() spin forever.
7
8 table: |
9 include tables/spaces.uti
10 include tables/braille-patterns.cti
11 lowercase a 1
12 lowercase b 12
13 lowercase c 14
14 # Chain: B is based on a (uppercase), A is based on B (custom attr).
15 # Because hash(A)=65 < hash(B)=66, the outer loop in finalizeTable
16 # visits A first, recursively finalizing B. Without the early-return
17 # guard in finalizeCharacter(), B would be finalized a second time
18 # when the loop reaches it, creating a cycle in a's linked list.
19 base uppercase B a
20 base myattr A B
21 # Caps indicators activate the emphasis code path that traverses the
22 # linked list inside isEmphasizable().
23 begcapsword 6-6
24 endcapsword 6-3
25
26 flags: {testmode: forward}
27 tests:
28 # Translating any text exercises isEmphasizable on every character.
29 # Before the fix this would hang forever.
30 - ["a b c", "⠁ ⠃ ⠉"]