From 2a5d89142dbd981a74c2649b05a3df7672b8c46f Mon Sep 17 00:00:00 2001 From: Ulrich Hornung Date: Mon, 15 Jan 2024 20:39:21 +0100 Subject: [PATCH] no executable "echo" on windows --- tests/by-util/test_env.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_env.rs b/tests/by-util/test_env.rs index f12ca47df91..4fb6e19bb8a 100644 --- a/tests/by-util/test_env.rs +++ b/tests/by-util/test_env.rs @@ -272,19 +272,20 @@ fn modify_newlines_according_platform(input: &str) -> String { } } +#[cfg(not(target_os = "windows"))] // windows has no executable "echo", its only supported as part of a batch-file #[test] fn test_split_string_into_args_one_argument_no_quotes() { let scene = TestScenario::new(util_name!()); let out = scene .ucmd() - .arg("-S echo hello world") // this is the only case where the "echo" from windows behaves like the echo from unix + .arg("-S echo hello world") .succeeds() .stdout_move_str(); assert_eq!(out, modify_newlines_according_platform("hello world\n")); } -#[cfg(not(target_os = "windows"))] // differences in behavior of "echo" +#[cfg(not(target_os = "windows"))] // windows has no executable "echo", its only supported as part of a batch-file #[test] fn test_split_string_into_args_one_argument() { let scene = TestScenario::new(util_name!()); @@ -297,7 +298,7 @@ fn test_split_string_into_args_one_argument() { assert_eq!(out, modify_newlines_according_platform("hello world\n")); } -#[cfg(not(target_os = "windows"))] // differences in behavior of "echo" +#[cfg(not(target_os = "windows"))] // windows has no executable "echo", its only supported as part of a batch-file #[test] fn test_split_string_into_args_s_escaping_challenge() { let scene = TestScenario::new(util_name!());