From 4e73b919e9ff96472433d0380c53383e892b6d80 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Fri, 21 May 2021 18:20:05 -0400 Subject: [PATCH] truncate: add test for -r and -s options together Add a test for when the reference file is not found and both `-r` and `-s` options are given on the command-line. --- tests/by-util/test_truncate.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/by-util/test_truncate.rs b/tests/by-util/test_truncate.rs index 34ba59094..a28ce9451 100644 --- a/tests/by-util/test_truncate.rs +++ b/tests/by-util/test_truncate.rs @@ -262,3 +262,11 @@ fn test_reference_file_not_found() { .fails() .stderr_contains("cannot stat 'a': No such file or directory"); } + +#[test] +fn test_reference_with_size_file_not_found() { + new_ucmd!() + .args(&["-r", "a", "-s", "+1", "b"]) + .fails() + .stderr_contains("cannot stat 'a': No such file or directory"); +}