From: Pádraig Brady Date: Mon, 3 Nov 2025 13:51:14 +0000 (+0000) Subject: tests: truncate: ensure negative args not parsed as options X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77322b31193cc4e89daa9f15fca7853023bcb42d;p=thirdparty%2Fcoreutils.git tests: truncate: ensure negative args not parsed as options * tests/truncate/truncate-parameters.sh: Add a test case. --- diff --git a/tests/truncate/truncate-parameters.sh b/tests/truncate/truncate-parameters.sh index 1b67c105c3..50c4f96699 100755 --- a/tests/truncate/truncate-parameters.sh +++ b/tests/truncate/truncate-parameters.sh @@ -51,4 +51,8 @@ test $(stat --format %s file) = 3 || fail=1 truncate -r file file2 || fail=1 #file2 now 3 test $(stat --format %s file2) = 3 || fail=1 +# Ensure separated argument not parsed as option +truncate -s -1 file || fail=1 #file now 2 +test $(stat --format %s file) = 2 || fail=1 + Exit $fail