summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/truncate-parameters12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/misc/truncate-parameters b/tests/misc/truncate-parameters
index 65240702a..c2f701970 100755
--- a/tests/misc/truncate-parameters
+++ b/tests/misc/truncate-parameters
@@ -30,7 +30,7 @@ truncate --size=0 && fail=1
# must specify size. don't default to 0
truncate file && fail=1
-# mixture of size & reference not allowed
+# mixture of absolute size & reference not allowed
truncate --size=0 --reference=file file && fail=1
# blocks without size is not valid
@@ -45,4 +45,14 @@ truncate --size=" >1" file || fail=1 #file now 1
truncate --size=" +1" file || fail=1 #file now 2
test $(stat --format %s file) = 2 || fail=1
+# reference allowed with relative size
+truncate --size=" +1" -r file file || fail=1 #file now 3
+test $(stat --format %s file) = 3 || fail=1
+
+# reference allowed alone also
+truncate -r file file || fail=1 #file still 3
+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
+
Exit $fail