Add refuse to overwrite test and fix format

This commit is contained in:
Sean Purcell 2017-04-06 17:06:30 -07:00
parent 9da11c6aae
commit 1652172b2d

View File

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