keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
386 stars 107 forks source link

feat(developer): emit ldml test case as markdown 🙀 #10815

Open srl295 opened 6 months ago

srl295 commented 6 months ago

Given LDML test format:

    <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>

... we could have a tool convert this into markdown so users can run the test manually, something like:

Test: key-8

press 8 Check that the result is 8:ctxt:OK

Test: key-8-osage

  1. copy this string: 𐓏
  2. press 8
  3. Check that the result is 8:ctxt:ok

This could be used to (for example) maintain a TESTING.md automatically in the https://github.com/keyman-keyboards/ldml_test repo, generated from the unit test xml.

related to #10192 and #10505

srl295 commented 6 months ago

see https://github.com/keyman-keyboards/ldml_test/pull/1 for a manually generated README

darcywong00 commented 1 month ago

Moving to A18S19, blocked by #5016