diff options
| author | Pádraig Brady <P@draigBrady.com> | 2025-11-03 13:51:14 +0000 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2025-11-03 13:52:54 +0000 |
| commit | 77322b31193cc4e89daa9f15fca7853023bcb42d (patch) | |
| tree | db8bde1ff897e0af82ec9ff50bffb7862fb5bb01 | |
| parent | date: avoid a duplicated write error diagnotic (diff) | |
| download | coreutils-77322b31193cc4e89daa9f15fca7853023bcb42d.tar.gz coreutils-77322b31193cc4e89daa9f15fca7853023bcb42d.zip | |
tests: truncate: ensure negative args not parsed as options
* tests/truncate/truncate-parameters.sh: Add a test case.
| -rwxr-xr-x | tests/truncate/truncate-parameters.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/truncate/truncate-parameters.sh b/tests/truncate/truncate-parameters.sh index 1b67c105c..50c4f9669 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 |
