From ae1d6bd48ec3d7ae81de336c2bc6fc1abac74f5e Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 26 Dec 2018 15:19:09 -0800 Subject: [PATCH] fixed playTests.sh for minGW On Windows, the equivalent of `/dev/null` is `NUL`. When tests are run under msys2/minGW, the environment identifies itself as Windows, hence the script uses `NUL` instead of `/dev/null` but the environment will consider `NUL` to be a regular file name. Consequently, `NUL` will be overwritten during tests, triggering an error. This patch uses flag `-f` to force such overwrite passing the test. --- programs/windres/zstd32.res | Bin 1044 -> 1044 bytes programs/windres/zstd64.res | Bin 1044 -> 1044 bytes tests/playTests.sh | 12 ++++++------ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/windres/zstd32.res b/programs/windres/zstd32.res index 2c2b9b01e53c7bbb4fa4e845fb51edd30b84475e..843499254924c1c45ed155677538d8856721f527 100644 GIT binary patch delta 33 ncmbQjF@ tmpCompressed $ZSTD tmp --stdout > tmpCompressed # long command format @@ -192,8 +192,8 @@ chmod 400 tmpro.zst $ZSTD -q tmpro && die "should have refused to overwrite read-only file" $ZSTD -q -f tmpro $ECHO "test: --no-progress flag" -$ZSTD tmpro -c --no-progress | $ZSTD -d -o "$INTOVOID" --no-progress -$ZSTD tmpro -cv --no-progress | $ZSTD -dv -o "$INTOVOID" --no-progress +$ZSTD tmpro -c --no-progress | $ZSTD -d -f -o "$INTOVOID" --no-progress +$ZSTD tmpro -cv --no-progress | $ZSTD -dv -f -o "$INTOVOID" --no-progress rm -f tmpro tmpro.zst $ECHO "test: overwrite input file (must fail)" $ZSTD tmp -fo tmp && die "zstd compression overwrote the input file" @@ -232,7 +232,7 @@ rm tmp* $ECHO "test : compress multiple files" $ECHO hello > tmp1 $ECHO world > tmp2 -$ZSTD tmp1 tmp2 -o "$INTOVOID" +$ZSTD tmp1 tmp2 -o "$INTOVOID" -f $ZSTD tmp1 tmp2 -c | $ZSTD -t $ZSTD tmp1 tmp2 -o tmp.zst test ! -f tmp1.zst @@ -240,7 +240,7 @@ test ! -f tmp2.zst $ZSTD tmp1 tmp2 $ZSTD -t tmp1.zst tmp2.zst $ZSTD -dc tmp1.zst tmp2.zst -$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID" +$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID" -f $ZSTD -d tmp1.zst tmp2.zst -o tmp touch tmpexists $ZSTD tmp1 tmp2 -f -o tmpexists