From f50b0048606ed943344a7058efb49806253b945f Mon Sep 17 00:00:00 2001 From: Jan Verbeek Date: Wed, 25 Aug 2021 17:54:55 +0200 Subject: [PATCH] wc: Adjust expected report for directories for Windows --- tests/by-util/test_wc.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/by-util/test_wc.rs b/tests/by-util/test_wc.rs index f74cd7b9d..eabaf58eb 100644 --- a/tests/by-util/test_wc.rs +++ b/tests/by-util/test_wc.rs @@ -206,14 +206,20 @@ fn test_file_bytes_dictate_width() { #[test] fn test_read_from_directory_error() { #[cfg(not(windows))] - const MSG: &str = ".: Is a directory"; + const STDERR: &str = ".: Is a directory"; #[cfg(windows)] - const MSG: &str = ".: Access is denied"; + const STDERR: &str = ".: Access is denied"; + + #[cfg(not(windows))] + const STDOUT: &str = " 0 0 0 .\n"; + #[cfg(windows)] + const STDOUT: &str = ""; + new_ucmd!() .args(&["."]) .fails() - .stderr_contains(MSG) - .stdout_is(" 0 0 0 .\n"); + .stderr_contains(STDERR) + .stdout_is(STDOUT); } /// Test that getting counts from nonexistent file is an error.