# A collection of tests related to whether or not it is needed to # define characters and braille cells (in character definition rules) # in order to be able to use them in other rules. # See also https://github.com/liblouis/liblouis/issues/332. # A cell in a multi-cell character definition does not need to be defined in its own character definition. # It works as long as there is a display rule to display the cell in the output... table: | display x 2 sign a 1 sign b 1-2 # ... or as long as the cell does not end up in output. table: | sign x 3 sign a 1 sign b 1-2 noback pass2 @2 @3 nofor pass2 @3 @2 flags: {testmode: bothDirections} tests: - - b - ax # If a cell ends up in the output and can not be displayed, it results in an error. # FIXME: use the expectedError flag (https://github.com/liblouis/liblouis/issues/875) # table: | # sign a 1 # sign b 1-2 # flags: {testmode: forward} # tests: # - - b # - "a " # A braille cell used in a begcapsword rule does not need to be previously defined in a character definition rule. # It works as long as there is a display rule to display the cell in the output... table: | display x 2 lowercase a 1 base uppercase A a begcapsword 2 # ... or as long as the cell does not end up in output. table: | sign x 3 lowercase a 1 base uppercase A a begcapsword 2 noback pass2 @2 @3 nofor pass2 @3 @2 flags: {testmode: bothDirections} tests: - - AA - xaa # If a cell ends up in the output and can not be displayed, it results in an error. # FIXME: use the expectedError flag (https://github.com/liblouis/liblouis/issues/875) # table: | # lowercase a 1 # base uppercase A a # begcapsword 2 # flags: {testmode: forward} # tests: # - - AA # - " aa" # Characters or braille cells used in a context rule do not need to be previously defined in character definition rules. table: | display x 1 noback context "a" @1 nofor context @1 "a" flags: {testmode: bothDirections} tests: - - a - x # A character used in a class or swap name does not need to be previously defined in a character definition rule. table: | sign a 1 sign b 2 sign c 3 attribute foo a swapcd bar b 3 noback context %foo @3 noback context %bar %bar flags: {testmode: forward} tests: - - a - c - - b - c # A character that is assigned to a class does not need to be previously defined in a character definition rule. table: | display x 1 attribute foo a noback context %foo @1 flags: {testmode: forward} tests: - - a - x # Characters in a hyphenation pattern do not need to be previously defined in character definition rules. table: | letter a 1 letter b 2 include issue-332_hyph.dic # a1b flags: {testmode: hyphenate} tests: - - aaabbb - aaa-bbb # Characters or braille cells used in a always rule do not need to be previously defined in character definition rules. # It works as long as there is a display rule to display the cell in the output... table: | display x 2 always abc 2 # ... or as long as the cell does not end up in output. table: | sign x 3 always abc 2 noback pass2 @2 @3 nofor pass2 @3 @2 flags: {testmode: bothDirections} tests: - - abc - x # If a cell ends up in the output and can not be displayed, it results in an error. # FIXME: use the expectedError flag (https://github.com/liblouis/liblouis/issues/875) # table: | # always a 2 # flags: {testmode: forward} # tests: # - - a # - " " # It does not matter whether the first character of the always rule is given an attribute or not (regression test for #1116) table: | display x 2 attribute foo a always abc 2 flags: {testmode: bothDirections} tests: - - abc - x