From 8330d17b40de95e18aeae82ac40d0d401c5f58f5 Mon Sep 17 00:00:00 2001 From: Binh Vo Date: Wed, 19 Jan 2022 21:34:07 -0500 Subject: [PATCH] Add simple tests --- tests/playTests.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/playTests.sh b/tests/playTests.sh index 695d4333ba4..bbb5980f14b 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -89,6 +89,7 @@ PRGDIR="$SCRIPT_DIR/../programs" TESTDIR="$SCRIPT_DIR/../tests" UNAME=$(uname) ZSTDGREP="$PRGDIR/zstdgrep" +ZSTDLESS="$PRGDIR/zstdless" detectedTerminal=false if [ -t 0 ] && [ -t 1 ] @@ -322,6 +323,16 @@ ZCAT=./zstdcat "$ZSTDGREP" 2>&1 "1234" tmp_grep_bad.zst && die "Should have fail ZCAT=./zstdcat "$ZSTDGREP" 2>&1 "1234" tmp_grep_bad.zst | grep "No such file or directory" || true rm -f tmp_grep* +println "\n===> zstdless tests" +rm -f tmp_less +echo "1234" > tmp_less +zstd -f tmp_less +lines=$("$ZSTDLESS" 2>&1 "1234" tmp.zst | wc -l) +test 1 -eq $lines +"$ZSTDLESS" 2>&1 "1234" tmp_less_bad.zst && die "Should have failed" +"$ZSTDLESS" 2>&1 "1234" tmp_less_bad.zst | grep "No such file or directory" || true +rm -f tmp_less* + println "\n===> --exclude-compressed flag" rm -rf precompressedFilterTestDir mkdir -p precompressedFilterTestDir