Background
tests/test_codegen.py has grown to 10,019 lines across 118 test classes. Finding tests for a specific feature, understanding failure scope, and parallelising CI execution are all harder than they need to be. This mirrors the situation that prompted the original codegen decomposition in #155.
Proposed split
| New file |
Test classes |
Theme |
tests/test_codegen_literals.py |
TestIntLit, TestBoolLit, TestFloatLit, TestByteLit |
Literal values |
tests/test_codegen_arithmetic.py |
TestArithmetic, TestComparison, TestFloatArithmetic, TestFloatComparison, TestFloatNeg |
Numeric ops |
tests/test_codegen_control_flow.py |
TestIfExpr, TestMatchExpr, TestLetStmt, TestForallExpr, TestExistsExpr, TestFloatIfExpr, TestFloatLet |
Control flow |
tests/test_codegen_strings.py |
All string operation test classes |
String builtins |
tests/test_codegen_arrays.py |
All array operation test classes |
Array builtins |
tests/test_codegen_collections.py |
Map and Set test classes |
Map/Set builtins |
tests/test_codegen_effects.py |
Http, Inference, IO effect test classes |
Effect codegen |
tests/test_codegen_data_types.py |
ADT constructor and pattern match test classes |
Data types |
tests/test_codegen_functions.py |
TestCompile, TestCompileResult, TestSlotRef, TestFloatSlotRef, TestFloatCompileResult |
Function compilation |
The shared helpers (_compile(), _compile_ok(), _run(), _run_float(), _run_io(), _run_trap()) move to tests/conftest.py so every split file can import them without duplication.
Acceptance criteria
- All existing tests are preserved (same count, same names)
pytest tests/ -v passes
- Each new file is under 1,500 lines
- No test helpers duplicated across files
Background
tests/test_codegen.pyhas grown to 10,019 lines across 118 test classes. Finding tests for a specific feature, understanding failure scope, and parallelising CI execution are all harder than they need to be. This mirrors the situation that prompted the original codegen decomposition in #155.Proposed split
tests/test_codegen_literals.pytests/test_codegen_arithmetic.pytests/test_codegen_control_flow.pytests/test_codegen_strings.pytests/test_codegen_arrays.pytests/test_codegen_collections.pytests/test_codegen_effects.pytests/test_codegen_data_types.pytests/test_codegen_functions.pyThe shared helpers (
_compile(),_compile_ok(),_run(),_run_float(),_run_io(),_run_trap()) move totests/conftest.pyso every split file can import them without duplication.Acceptance criteria
pytest tests/ -vpasses