blob: 5a6c28cbcd6cd3797692e2fb70e8f9ad8bcd4d25 [file] [log] [blame]
# Tests for #507: mixed lower and upper case.
# we define a very simple table and just test whether the word rule
# matches when we encounter mixed case input. Since we do not define
# any caps rules we expect liblouis to ignore capitalization
table: |
include tables/de-chardefs6.cti
word mit 2345
tests:
- [mit, t]
- [Mit, t, {xfail: "returns 'mit' instead"}]
- [MIT, t]
- [mIt, t, {xfail: "returns 'mit' instead"}]
- [miT, t, {xfail: "returns 'mit' instead"}]
# same test as above basically but this time using an always rule
# instead of a word rule
table: |
include tables/de-chardefs6.cti
always mit 2345
tests:
- [mit, t]
- [Mit, t, {xfail: "returns 'mit' instead"}]
- [MIT, t]
- [mIt, t, {xfail: "returns 'mit' instead"}]
- [miT, t, {xfail: "returns 'mit' instead"}]
# here's another test similar to the first one just using a different
# input text
table: |
include tables/de-chardefs6.cti
word man 134
tests:
- [man, m]
- [Man, m, {xfail: "returns 'man' instead"}]
- [MAN, m]
- [maN, m, {xfail: "returns 'man' instead"}]
- [mAn, m, {xfail: "returns 'man' instead"}]
# when enabling capitalization using a capsletter rule everything
# works as expected
table: |
include tables/de-chardefs6.cti
always mit 2345
sign $ 46
capsletter 46
tests:
- [mit, t]
- [Mit, $t]
- [MIT, t]
- [mIt, m$it]
- [miT, mi$t]
# Now, let's try to add capitalization and remove it later in a pass2.
# This does not work. The mixed case mIt prevents contraction, so
# removing the capitalization doesn't help (at least no in all cases)
table: |
include tables/de-chardefs6.cti
always mit 2345
sign $ ef
capsletter ef
noback pass2 @ef ?
tests:
- [mit, t]
- [Mit, t]
- [MIT, t]
- [mIt, t, {xfail: "returns 'man' instead"}]
- [miT, t, {xfail: "returns 'man' instead"}]
# Finally let's try to disable capitalization by correcting the input
# to be all lowercase. This works.
table: |
include tables/de-chardefs6.cti
word mit 2345
swapcc toLowercase ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
noback correct %toLowercase %toLowercase
tests:
- [mit, t]
- [Mit, t]
- [MIT, t]
- [mIt, t]
- [miT, t]