diff --git a/quality-check.sh b/quality-check.sh index 62c08ef..416c1b4 100755 --- a/quality-check.sh +++ b/quality-check.sh @@ -79,10 +79,11 @@ echo "==============================" echo "" echo "📊 Test Results Summary:" echo " • Unit tests: ✅ 6 passed" -echo " • Integration tests: ✅ 14 passed" +echo " • CLI binary tests: ✅ 2 passed" +echo " • Integration tests: ✅ 14 passed" echo " • Integration examples: ✅ 15 passed" echo " • Documentation tests: ✅ 40 passed" -echo " • Total: 75 tests passed" +echo " • Total: 77 tests passed" echo "" echo "🛡️ Security & Quality:" echo " • Zero clippy warnings: ✅" diff --git a/src/main.rs b/src/main.rs index ddff6ff..c3ab5e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -415,3 +415,32 @@ fn print_results_json(results: &[TestResult]) { println!("{}", serde_json::to_string_pretty(&json_results).unwrap()); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_cli_construction() { + // Test that CLI can be constructed without panicking + // This is a basic smoke test for the CLI interface + use clap::Parser; + + // Test help command doesn't panic + let result = std::panic::catch_unwind(|| { + let _ = cli::Cli::try_parse_from(&["nettest", "--help"]); + }); + assert!(result.is_ok(), "CLI help command should not panic"); + } + + #[test] + fn test_version_command() { + // Test version command + use clap::Parser; + + let result = std::panic::catch_unwind(|| { + let _ = cli::Cli::try_parse_from(&["nettest", "--version"]); + }); + assert!(result.is_ok(), "CLI version command should not panic"); + } +}