Skip to content

test(ezc): comprehensive test coverage#1186

Merged
SchoolyB merged 1 commit intov3.0.0from
ezc/test-coverage
Mar 22, 2026
Merged

test(ezc): comprehensive test coverage#1186
SchoolyB merged 1 commit intov3.0.0from
ezc/test-coverage

Conversation

@SchoolyB
Copy link
Owner

Summary

Adds 50 new tests across two new test suites and fixes a regression in return type parsing.

New: Type Checker Tests (26 tests)

  • Scope: define, lookup, nesting, shadowing, undefined
  • Type constructors: primitives, arrays, structs, numeric checks
  • Expression resolution: literals, arithmetic, comparisons, logical, negation, arrays
  • Builtins: len, typeof, to_float
  • Struct field and function return type resolution

New: End-to-End Codegen Tests (24 tests)

Compile EZ snippets → run binaries → verify output:

  • Hello world, arithmetic, variables, string interpolation
  • Control flow: if/or/otherwise, for/range, while, loop/break
  • Functions: calls, recursion, multi-return, mutable params, ensure
  • Types: structs, enums, arrays, array mutation, for_each, when/is
  • Builtins: len, typeof, compound assignment, char, blank identifier

Fix: Return Type Parsing Regression

-> (int, int) was incorrectly parsed as a shared-type named return (treating int as a variable name). Added type name detection to disambiguate plain types from variable names in return type lists.

Test Targets

  • make test-unit — 61 tests (lexer + parser + type checker)
  • make test-e2e — 24 tests (compile and run)
  • make test — all 85 tests + parity

Results

85/85 tests passing

…sing

Tests:
- 26 type checker unit tests: scope, type resolution, builtins,
  structs, functions
- 24 end-to-end codegen tests: compile EZ snippets, run binaries,
  verify output
- Total: 85 tests, all passing

Fix: plain type return lists -> (int, int) were incorrectly
parsed as shared-type named returns. Added type name detection
to disambiguate.
@SchoolyB SchoolyB changed the title feat(ezc): comprehensive test coverage — 85 tests, return type fix test(ezc): comprehensive test coverage Mar 22, 2026
@SchoolyB SchoolyB merged commit 3fc3ef4 into v3.0.0 Mar 22, 2026
2 checks passed
@SchoolyB SchoolyB deleted the ezc/test-coverage branch March 22, 2026 03:28
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