Skip to content

Commit

Permalink
chore(core): update sample ldml keyboard
Browse files Browse the repository at this point in the history
Fixes: #10505
  • Loading branch information
srl295 committed Feb 20, 2024
1 parent eb86291 commit 9ef198f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
35 changes: 35 additions & 0 deletions core/tests/unit/ldml/keyboards/ldml_test-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,40 @@
<keystroke key="6" />
<check result="6:map_var:OK" />
</test>
<test name="key-7">
<keystroke key="7" />
<check result="7:simple_uset:OK" />
</test>
<test name="key-shift-7">
<keystroke key="shift-7" />
<check result="7:simple_uset:FAIL" />
</test>
<test name="key-8">
<startContext to="ABC" />
<keystroke key="8" />
<check result="8:ctxt:OK" />
</test>
<test name="key-8-fail">
<startContext to="" /> <!-- w/o context -->
<keystroke key="8" />
<check result="8:ctxt:FAIL"/>
</test>
<test name="key-8-osage">
<startContext to="𐓏" />
<keystroke key="8" />
<check result="8:ctxt:OK" />
</test>
<test name="key-8-osage2">
<startContext to="𐒻" />
<keystroke key="shift-8" />
<keystroke key="8" />
<check result="8:ctxt:OK" />
</test>
<test name="key-9">
<startContext to="" />
<keystroke key="9" />
<keystroke key="shift-9" />
<check result="9:split_marker:OK" />
</test>
</tests>
</keyboardTest3>
17 changes: 16 additions & 1 deletion core/tests/unit/ldml/keyboards/ldml_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<key id="4" output="4:simple_reorder:UNTIED" />
<key id="5" output="5:simple_vars:${varsok}"/>
<key id="6" output="6:map_var:B\m{map1}X\m{map2}"/>
<key id="7" output="7:simple_uset:FAIL\m{uset7}" /> <!-- will produce OK-->
<key id="shift-7" output="7:simple_uset:OK\m{uset7}" /> <!-- will produce FAIL-->
<key id="8" output="\m{8ctxt}8:ctxt:FAIL" />
<key id="shift-8" output="𐒷" />
<key id="9" output="9:split_marker:FAIL\m{marker1}" />
<key id="shift-9" output="\m{marker2}" />
</keys>

<layers formId="us">
Expand All @@ -24,7 +30,7 @@
<row keys="space"/>
</layer>
<layer modifiers="shift">
<row keys="tilde bang at hash dollar percent caret amp asterisk open-paren close-paren underscore plus"/>
<row keys="tilde bang at hash dollar percent caret shift-7 shift-8 shift-9 close-paren underscore plus"/>
<row keys="Q W E R T Y U I O P open-curly close-curly pipe"/>
<row keys="A S D F G H J K L colon double-quote"/>
<row keys="Z X C V B N M open-angle close-angle question"/>
Expand Down Expand Up @@ -54,6 +60,9 @@
<!-- 6: regular and rot13 alphabet -->
<set id="alpha" value="$[alpha1] $[alpha2]"/>
<set id="nycun" value="$[alpha2] $[alpha1]"/> <!-- 'nycun' in rot13 -->
<!-- 7: uset -->
<unicodeSet id="7ok" value="[[A_LIFE]-[E]]" /> <!-- = the chars [FAIL]-->
<unicodeSet id="7notok" value="[[A-Z]-$[7ok]]"/> <!-- everything not in [FAIL]-->
</variables>

<transforms type="simple">
Expand Down Expand Up @@ -98,16 +107,22 @@
<!-- 6: swap back -->
<transformGroup>
<transform from="($[alpha])\m{map2}($[alpha])\m{map1}" to="$2\m{map1}$1\m{map2}" />
<transform from=":(?:$[7notok])+\m{uset7}" to=":FAIL" />
<transform from=":(?:$[7ok])+\m{uset7}" to=":OK" />
</transformGroup>
<transformGroup>
<transform from="simple_transform:FAIL" to="simple_transform:OK" />
<!-- 3: interpret marker results -->
<transform from="FAIL\m{marker}" to="OK" />
<transform from="FAIL\m{marker1}\m{marker2}" to="OK" />
<!-- 4: interpret reorder results -->
<transform from="UNITED" to="OK" />
<transform from="UNTIED" to="FAIL" />
<!-- 6: if untransformed, BX is a failure. -->
<transform from=":B\m{.}X\m{.}" to=":FAIL"/>
<transform from="ABC\m{8ctxt}(8:ctxt):FAIL" to="$1:OK" />
<transform from="𐓏\m{8ctxt}(8:ctxt):FAIL" to="$1:OK" />
<transform from="𐒻𐒷\m{8ctxt}(8:ctxt):FAIL" to="$1:OK" />
</transformGroup>
</transforms>

Expand Down

0 comments on commit 9ef198f

Please sign in to comment.