-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Problem
The src/tests.zig file has grown to 1400+ lines and contains tests for multiple unrelated modules:
- Math (Vec3, Mat4, AABB, Frustum)
- World (Chunk, BlockType, PackedLight)
- Worldgen (Noise, generators)
- Meshing (AO calculator, lighting sampler)
- Texture atlas
- Biome constraints
This monolithic test file is difficult to navigate and maintain.
Current State
One file (src/tests.zig) contains tests for 15+ different modules.
Proposed Solution
Create a src/tests/ directory with module-specific test files:
src/tests/
├── main.zig # Test runner/imports
├── math.zig # Vec3, Mat4, AABB tests
├── chunk.zig # Chunk, BlockType, PackedLight tests
├── worldgen.zig # Noise, generator tests
├── meshing.zig # AO, lighting sampler tests
└── texture.zig # TextureAtlas tests
Benefits
- Tests are co-located by module
- Easier to find and run specific test suites
- Reduced merge conflicts in test files
- Clearer organization
Acceptance Criteria
- Create
src/tests/directory - Split tests into logical files by module
- Update
build.zigto run all tests - All existing tests preserved
- Tests still pass
- Document new test organization in README or AGENTS.md
Related Files
src/tests.zigbuild.zig
Estimated Effort
Low-Medium (mostly moving code)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation