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 a2c4516 commit e59e72b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 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,15 @@ 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 tmp_less.zst | wc -l)
test 1 -eq $lines
"$ZSTDLESS" 2>&1 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 e59e72b

Please sign in to comment.