Skip to content

Add unit tests for the Khmer Braille converter #2

Description

@sengtha

What

Add unit tests for the Khmer → Braille conversion in packages/core/src/khmerbraille.ts.

Why

The converter has non-trivial rules (pre-base vowel reordering, coeng-រ handling, composite-vowel merging, BRF → Unicode mapping). Tests would lock in correct behavior and make future fixes safe.

Where to start

  • Source: packages/core/src/khmerbraille.ts (exports khmerToBrf, brfToUnicodeBraille, khmerToBraille).
  • Add a test file next to it (e.g. packages/core/src/khmerbraille.test.ts).
  • Cover: digits, a few consonants, a pre-base vowel word (e.g. reordering), a coeng cluster, and a composite vowel from the COMBOS list. Round-trip khmerToBraille on a short sentence.
  • If no test runner is set up yet in packages/core, wiring up a lightweight one (e.g. vitest) as part of this issue is welcome — keep it minimal.

Acceptance

  • Tests run and pass locally; a few meaningful cases covered.
  • No changes to the converter's public API.

Note: some vowel/punctuation cells are still worth a human proofread against the official Khmer Braille chart — tests here are about locking in current behavior, not certifying the chart.

Good for someone comfortable with TypeScript who wants a focused, verifiable task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions