refactor: colocate cmd tests with their modules

Move tests from the monolithic tests.rs into #[cfg(test)] mod tests
blocks in each command module. Shared test helpers live in
mod.rs::test_helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Executed-By: fido
This commit is contained in:
Edward Langley
2026-04-09 02:49:25 -07:00
parent 001744f5cf
commit 4d7d91257d
13 changed files with 1384 additions and 1409 deletions

View File

@ -275,3 +275,23 @@ pub(super) fn parse_axis(s: &str) -> Result<Axis, String> {
other => Err(format!("Unknown axis: {other}")),
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parse_axis_recognizes_all_variants() {
assert!(parse_axis("row").is_ok());
assert!(parse_axis("column").is_ok());
assert!(parse_axis("col").is_ok());
assert!(parse_axis("page").is_ok());
assert!(parse_axis("none").is_ok());
assert!(parse_axis("ROW").is_ok());
}
#[test]
fn parse_axis_rejects_unknown() {
assert!(parse_axis("diagonal").is_err());
}
}