Skip to content

refactor: type safety, architecture cleanup, and test coverage improvements#26

Open
vantreeseba wants to merge 12 commits into
mainfrom
refactor/review-fixes
Open

refactor: type safety, architecture cleanup, and test coverage improvements#26
vantreeseba wants to merge 12 commits into
mainfrom
refactor/review-fixes

Conversation

@vantreeseba

Copy link
Copy Markdown
Member

Summary

  • Replaced Array<Dynamic> rewriteset with a typed RewriteRule typedef across Rewrite, Language, and Consts
  • Added explicit Map<String, String> return type to Language.translate
  • Moved Graphemes typedef from Language.hx to Orthography.hx where it belongs
  • Fixed createPhrase noun filter to compare generated word values instead of hardcoded English keys ("the"/"of")
  • Extracted generic randomFromMap helper in Consts, eliminating 8 duplicate getRandomXxxSet method bodies
  • Removed redundant {1} quantifiers from Rewrite.parseRule character class expansions
  • Extracted randommin before the config block to remove a side-effect assignment inside a struct literal
  • Fixed @BeforeClass@Before in OrthographyTest so the instance field is correctly initialized per test
  • Expanded test suite from 30 → 45 tests covering seed determinism, translate correctness, C-expansion in rewrite rules, multi-rule sequencing, and full Consts getter coverage

Test plan

  • All 45 tests pass (npm test)
  • No behaviour changes — only type safety, structure, and test coverage

🤖 Generated with Claude Code

vantreeseba and others added 12 commits May 4, 2026 15:45
…pedef

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t belongs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d English keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…omXxxSet functions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lass expansions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… assignment in struct literal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nitialize instance field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ss, and phrase subject assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ilants, liquids, finals, ortho

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…raphyTest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s to RewriteTest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant