Problem
Tests in leanSig are currently written as inline #[cfg(test)] modules at the bottom of each source file. As the codebase grows, this makes test files harder to navigate, bloats source files, and makes it difficult to get a clear picture of test coverage at a glance.
Proposal
Migrate tests out of inline modules and into a dedicated tests/ directory structure that mirrors src/. For example:
src/
├── symmetric/
│ └── message_hash/
│ └── poseidon.rs
└── inc_encoding/
└── target_sum.rs
tests/
├── symmetric/
│ └── message_hash/
│ └── poseidon.rs
└── inc_encoding/
└── target_sum.rs
Each test file maps 1:1 to its corresponding source file, keeping test logic
isolated and easy to locate.
Benefits
- Source files stay focused on implementation only
- Test coverage gaps are immediately visible from the directory tree
- Easier for new contributors to find and add tests
- Aligns with how larger Rust projects structure integration-level tests
Notes
Unit tests that need access to private internals can stay inline where necessary. The goal is to move tests for public interfaces and behaviour into the tests/ tree by default.
Problem
Tests in leanSig are currently written as inline
#[cfg(test)]modules at the bottom of each source file. As the codebase grows, this makes test files harder to navigate, bloats source files, and makes it difficult to get a clear picture of test coverage at a glance.Proposal
Migrate tests out of inline modules and into a dedicated
tests/directory structure that mirrorssrc/. For example:src/
├── symmetric/
│ └── message_hash/
│ └── poseidon.rs
└── inc_encoding/
└── target_sum.rs
tests/
├── symmetric/
│ └── message_hash/
│ └── poseidon.rs
└── inc_encoding/
└── target_sum.rs
Each test file maps 1:1 to its corresponding source file, keeping test logic
isolated and easy to locate.
Benefits
Notes
Unit tests that need access to private internals can stay inline where necessary. The goal is to move tests for public interfaces and behaviour into the
tests/tree by default.