Skip to content

Commit

Permalink
Add simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
binhdvo committed Jan 20, 2022
1 parent 29a7997 commit 8330d17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/playTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8330d17

Please sign in to comment.