1#!/bin/sh 2 3set -e 4 5. "$COMMON/platform.sh" 6 7echo "" > 1 8echo "2" > 2 9echo "23" > 3 10echo "234" > 4 11echo "some data" > file 12 13println "+ passthrough enabled" 14 15zstd file 16 17# Test short files 18zstd -dc --pass-through 1 2 3 4 19 20# Test *cat symlinks 21zstdcat file 22"$ZSTD_SYMLINK_DIR/zcat" file 23"$ZSTD_SYMLINK_DIR/gzcat" file 24 25# Test multiple files with mix of compressed & not 26zstdcat file file.zst 27zstdcat file.zst file 28 29# Test --pass-through 30zstd -dc --pass-through file 31zstd -d --pass-through file -o pass-through-file 32 33# Test legacy implicit passthrough with -fc 34zstd -dcf file 35zstd -dcf file file.zst 36zstd -df < file 37zstd -dcf < file file.zst - 38zstd -dcf < file.zst file - 39 40$DIFF file pass-through-file 41 42println "+ passthrough disabled" 43 44# Test *cat 45zstdcat --no-pass-through file && die "should fail" 46"$ZSTD_SYMLINK_DIR/zcat" --no-pass-through file && die "should fail" 47"$ZSTD_SYMLINK_DIR/gzcat" --no-pass-through file && die "should fail" 48# Test zstd without implicit passthrough 49zstd -d file -o no-pass-through-file && die "should fail" 50zstd -d < file && die "should fail" 51 52# Test legacy implicit passthrough with -fc 53zstd --no-pass-through -dcf file && die "should fail" 54zstd --no-pass-through -dcf file file.zst && die "should fail" 55zstd --no-pass-through -df < file && die "should fail" 56zstd --no-pass-through -dcf < file file.zst - && die "should fail" 57zstd --no-pass-through -dcf < file.zst file - && die "should fail" ||: 58