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:
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user