From 77322b31193cc4e89daa9f15fca7853023bcb42d Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Mon, 3 Nov 2025 13:51:14 +0000 Subject: [PATCH] tests: truncate: ensure negative args not parsed as options * tests/truncate/truncate-parameters.sh: Add a test case. --- tests/truncate/truncate-parameters.sh | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.47.3