From b34215f1575bb85521c56ec4f3de6f30d0721d1c Mon Sep 17 00:00:00 2001 From: overtrue Date: Fri, 17 Apr 2026 22:04:14 +0800 Subject: [PATCH] test(cli): cover version output contract --- crates/cli/tests/help_contract.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/cli/tests/help_contract.rs b/crates/cli/tests/help_contract.rs index b62b1e4..bd1662b 100644 --- a/crates/cli/tests/help_contract.rs +++ b/crates/cli/tests/help_contract.rs @@ -95,6 +95,20 @@ fn assert_help_case(case: &HelpCase) { } } +#[test] +fn binary_version_matches_package_version() { + let output = run_rc(&["--version"]); + + assert!( + output.status.success(), + "version output should succeed: stderr={}", + String::from_utf8_lossy(&output.stderr) + ); + + let stdout = String::from_utf8_lossy(&output.stdout); + assert_eq!(stdout.trim(), format!("rc {}", env!("CARGO_PKG_VERSION"))); +} + #[test] fn top_level_command_help_contract() { let cases = [