Skip to content

[T-004] Add Vitest framework and 40 unit tests for core FLUX modules#1

Open
SuperInstance wants to merge 1 commit intomainfrom
greenhorn/T-004-multilingual
Open

[T-004] Add Vitest framework and 40 unit tests for core FLUX modules#1
SuperInstance wants to merge 1 commit intomainfrom
greenhorn/T-004-multilingual

Conversation

@SuperInstance
Copy link
Copy Markdown
Owner

@SuperInstance SuperInstance commented Apr 12, 2026

Summary

  • Added Vitest testing framework (previously 0 tests)
  • Created 7 test files covering all core modules
  • Fixed 2 bugs in vocabulary.ts (Python regex syntax → ES2018)
  • 40 tests across: encoder, decoder, vm, vocabulary, compiler, tiling, languages

Bug Fixes

  1. Regex named groups: (?P<name>...)(?<name>...) (ES2018)
  2. Named group access: match["name"]match.groups["name"]

Testing

  • bun run test → 7 files, 40/40 passed in 783ms

Staging: Open in Devin

…-004)

- Install vitest + add vitest.config.ts and test scripts
- Add 6 encoder tests (MOVI, IADD, HALT, labels, comments, quickEncode)
- Add 5 decoder tests (disassemble, format round-trip, bytecodeToHex, formatAssembly)
- Add 6 VM tests (load/immediate, arithmetic, div-by-zero, max cycles, quickExec)
- Add 9 vocabulary tests (matchVocabulary, expandAssembly, matchAllVocabulary)
- Add 2 compiler tests (compile NL expression, unrecognized input error)
- Add 5 tiling tests (compose deps, matchHighestTile, getTilesByLevel)
- Add 7 language registry tests (getLanguageByCode, searchLanguages)
- Fix vocabulary.ts: use (?<name>...) regex syntax for Bun/JSC compat
- Fix vocabulary.ts: access named groups via match.groups instead of match
Copy link
Copy Markdown

@beta-devin-ai-integration beta-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Staging: Open in Devin

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