diff --git a/tests/test_util_name.rs b/tests/test_util_name.rs index 114feae15d9..bbc15a13290 100644 --- a/tests/test_util_name.rs +++ b/tests/test_util_name.rs @@ -271,6 +271,24 @@ fn util_invalid_name_invalid_command() { assert_eq!(code, Some(1)); } +#[test] +#[cfg(unix)] +#[cfg(all(feature = "true", feature = "false"))] +fn util_prefix() { + let scenario = TestScenario::new("false-falsetrue"); + symlink_file( + &scenario.bin_path, + scenario.fixtures.plus("false-falsetrue"), + ) + .unwrap(); + let code = std::process::Command::new(scenario.fixtures.plus("false-falsetrue")) + .status() + .unwrap() + .code(); + // `true` with` the prefix `false-false` is `true`. + assert_eq!(code, Some(0)); +} + #[test] fn util_version() { use std::process::{Command, Stdio};