- Use the `unittest` module with `suite` and `test` blocks for organizing tests — run with `nim r tests/test_mymodule.nim` or `nimble test`.
- Use `check expr` for simple assertions and `expect ExceptionType: block` to assert that a code block raises a specific exception type.
- Place test files in a `tests/` directory mirroring the `src/` structure — name test files `t_<module>.nim` or `test_<module>.nim` consistently.
- Use `testament` (the official Nim test runner) for running the full test suite with output comparison and spec-driven test files — define expected output in `# Output:` comments.