tests: truncate: ensure negative args not parsed as options

* tests/truncate/truncate-parameters.sh: Add a test case.
This commit is contained in:
Pádraig Brady 2025-11-03 13:51:14 +00:00
parent cb0ab4ef39
commit 77322b3119

View File

@ -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