]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add refuse to overwrite test and fix format 650/head
authorSean Purcell <me@seanp.xyz>
Fri, 7 Apr 2017 00:06:30 +0000 (17:06 -0700)
committerSean Purcell <me@seanp.xyz>
Fri, 7 Apr 2017 00:06:30 +0000 (17:06 -0700)
tests/playTests.sh

index 5409d9aa1ef9617432d18963280814c6566304a8..266bbd91bad4c5331ffea904a7e2c0907b83b82a 100755 (executable)
@@ -110,12 +110,13 @@ $ECHO "test : force overwrite"
 $ZSTD -q -f tmp
 $ZSTD -q --force tmp
 $ECHO "test : overwrite readonly file"
+rm -f tmpro tmpro.zst
 $ECHO foo > tmpro.zst
 $ECHO foo > tmpro
 chmod 400 tmpro.zst
-$ZSTD -q --force tmpro || die "failed to overwrite read-only file"
-chmod 600 tmpro.zst
-rm tmpro tmpro.zst
+$ZSTD -q tmpro && die "should have refused to overwrite read-only file"
+$ZSTD -q -f tmpro
+rm -f tmpro tmpro.zst
 $ECHO "test : file removal"
 $ZSTD -f --rm tmp
 ls tmp && die "tmp should no longer be present"