From b0452cb367305358c92025fb4cf8d2377ed871e6 Mon Sep 17 00:00:00 2001 From: Rayhan Faizel Date: Thu, 10 Aug 2023 08:37:28 +0530 Subject: [PATCH] stat: Output error when - and -f are used together. --- tests/by-util/test_stat.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/by-util/test_stat.rs b/tests/by-util/test_stat.rs index 92a8bcd9881..d932b35d6ea 100644 --- a/tests/by-util/test_stat.rs +++ b/tests/by-util/test_stat.rs @@ -304,6 +304,19 @@ fn test_stdin_pipe_fifo2() { .succeeded(); } +#[test] +#[cfg(all(unix, not(target_os = "android")))] +fn test_stdin_with_fs_option() { + // $ stat -f - + new_ucmd!() + .arg("-f") + .arg("-") + .set_stdin(std::process::Stdio::null()) + .fails() + .code_is(1) + .stderr_contains("using '-' to denote standard input does not work in file system mode"); +} + #[test] #[cfg(all( unix,