From 414385926653fc14d1f692e638059b36b5c566ae Mon Sep 17 00:00:00 2001 From: Rayhan Faizel Date: Thu, 10 Aug 2023 08:41:19 +0530 Subject: [PATCH] tests/stat: Test case for using - and -f 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,