From c830daf08212b6e4dc680ca6589850d1a442194e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 1 Dec 2026 20:09:32 +0900 Subject: [PATCH] coreutils: add test case for prefix --- tests/test_util_name.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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};