rm tmpCompressed
zstd tmp -o tmpCompressed
test -f tmpCompressed # file must be created
-println "test : -o must be followed by filename (must fail)"
-zstd tmp -of tmpCompressed && die "-o must be followed by filename "
println "test : force write, correct order"
zstd tmp -fo tmpCompressed
println "test : forgotten argument"
test -f tmp2.zst
test -f tmp1.zst
+println "test : alternate syntax: --filelist FILE"
+zstd -f --filelist tmp_fileList
+test -f tmp2.zst
+test -f tmp1.zst
+
println "test : reading file list from a symlink, --filelist=FILE"
rm -f *.zst
ln -s tmp_fileList tmp_symLink
die "hinted compression larger than expected"
fi
println "test : sized streaming compression and decompression"
-cat tmp | zstd -14 -f tmp -o --stream-size=11000 tmp.zst
+cat tmp | zstd -14 -f tmp -o tmp.zst --stream-size=11000
zstd -df tmp.zst -o tmp_decompress
cmp tmp tmp_decompress || die "difference between original and decompressed file"
println "test : incorrect stream size"
zstd -f tmp -D tmpDict1 --no-dictID
zstd -d tmp.zst -D tmpDict -fo result
$DIFF "$TESTFILE" result
-println "- Compress with wrong argument order (must fail)"
-zstd tmp -Df tmpDict1 -c > $INTOVOID && die "-D must be followed by dictionary name "
println "- Compress multiple files with dictionary"
rm -rf dirTestDict
mkdir dirTestDict
zstd -f -vv --rsyncable --single-thread tmp && die "--rsyncable must fail with --single-thread"
fi
-println "\n===> patch-from tests"
-
+println "\n===> patch-from=origin tests"
datagen -g1000 -P50 > tmp_dict
datagen -g1000 -P10 > tmp_patch
zstd --patch-from=tmp_dict tmp_patch -o tmp_patch_diff
zstd -d --patch-from=tmp_dict tmp_patch_diff -o tmp_patch_recon
$DIFF -s tmp_patch_recon tmp_patch
+
+println "\n===> alternate syntax: patch-from origin"
+zstd -f --patch-from tmp_dict tmp_patch -o tmp_patch_diff
+zstd -df --patch-from tmp_dict tmp_patch_diff -o tmp_patch_recon
+$DIFF -s tmp_patch_recon tmp_patch
rm -rf tmp_*
println "\n===> patch-from recursive tests"
-
mkdir tmp_dir
datagen > tmp_dir/tmp1
datagen > tmp_dir/tmp2
rm -rf tmp*
println "\n===> patch-from long mode trigger larger file test"
-
datagen -g5000000 > tmp_dict
datagen -g5000000 > tmp_patch
zstd -15 --patch-from=tmp_dict tmp_patch 2>&1 | grep "long mode automatically triggered"