diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2022-10-25 06:47:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 06:47:31 (GMT) |
commit | 214bfb325bd4db112b73859912b919aa35e12d61 (patch) | |
tree | b5c04cd31e42772751dac47bc6a0780b581b871d /tests/test-lz4-multiple.sh | |
parent | e312412c60140b3d061526499cef22e5e99d7751 (diff) | |
parent | 198e532300f253ada3acac3ab5428ed991adb085 (diff) | |
download | lz4-214bfb325bd4db112b73859912b919aa35e12d61.zip lz4-214bfb325bd4db112b73859912b919aa35e12d61.tar.gz lz4-214bfb325bd4db112b73859912b919aa35e12d61.tar.bz2 |
Merge pull request #1139 from tristan957/meson
Update Meson build to 1.9.4
Diffstat (limited to 'tests/test-lz4-multiple.sh')
-rwxr-xr-x | tests/test-lz4-multiple.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/test-lz4-multiple.sh b/tests/test-lz4-multiple.sh new file mode 100755 index 0000000..3c854d4 --- /dev/null +++ b/tests/test-lz4-multiple.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +FPREFIX="tmp-tml" + +set -e + +remove () { + rm $FPREFIX* +} + +trap remove EXIT + +set -x + +datagen -s1 > ${FPREFIX}1 2> $FPREFIX-trash +datagen -s2 -g100K > ${FPREFIX}2 2> $FPREFIX-trash +datagen -s3 -g200K > ${FPREFIX}3 2> $FPREFIX-trash +# compress multiple files : one .lz4 per source file +lz4 -f -m $FPREFIX* +test -f ${FPREFIX}1.lz4 +test -f ${FPREFIX}2.lz4 +test -f ${FPREFIX}3.lz4 +# decompress multiple files : one output file per .lz4 +mv ${FPREFIX}1 ${FPREFIX}1-orig +mv ${FPREFIX}2 ${FPREFIX}2-orig +mv ${FPREFIX}3 ${FPREFIX}3-orig +lz4 -d -f -m $FPREFIX*.lz4 +cmp ${FPREFIX}1 ${FPREFIX}1-orig # must be identical +cmp ${FPREFIX}2 ${FPREFIX}2-orig +cmp ${FPREFIX}3 ${FPREFIX}3-orig +# compress multiple files into stdout +cat ${FPREFIX}1.lz4 ${FPREFIX}2.lz4 ${FPREFIX}3.lz4 > $FPREFIX-concat1 +rm $FPREFIX*.lz4 +lz4 -m ${FPREFIX}1 ${FPREFIX}2 ${FPREFIX}3 -c > $FPREFIX-concat2 +test ! -f ${FPREFIX}1.lz4 # must not create .lz4 artefact +cmp $FPREFIX-concat1 $FPREFIX-concat2 # must be equivalent +# decompress multiple files into stdout +rm $FPREFIX-concat1 $FPREFIX-concat2 +lz4 -f -m ${FPREFIX}1 ${FPREFIX}2 ${FPREFIX}3 # generate .lz4 to decompress +cat ${FPREFIX}1 ${FPREFIX}2 ${FPREFIX}3 > $FPREFIX-concat1 # create concatenated reference +rm ${FPREFIX}1 ${FPREFIX}2 ${FPREFIX}3 +lz4 -d -m ${FPREFIX}1.lz4 ${FPREFIX}2.lz4 ${FPREFIX}3.lz4 -c > $FPREFIX-concat2 +test ! -f ${FPREFIX}1 # must not create file artefact +cmp $FPREFIX-concat1 $FPREFIX-concat2 # must be equivalent +# compress multiple files, one of which is absent (must fail) +lz4 -f -m $FPREFIX-concat1 notHere $FPREFIX-concat2 && exit 1 # must fail : notHere not present +# test lz4-compressed file +rm $FPREFIX-concat1 $FPREFIX-concat2 +lz4 -tm $FPREFIX-concat1.lz4 +# ensure the test doesn't create artifact +test ! -f $FPREFIX-concat1 # must not create file artefact +# test multiple lz4-compressed file +lz4 -tm $FPREFIX-concat1.lz4 $FPREFIX-concat2.lz4 +test ! -f $FPREFIX-concat1 # must not create file artefact +test ! -f $FPREFIX-concat2 # must not create file artefact +# test multiple lz4 files, one of which is absent (must fail) +lz4 -tm $FPREFIX-concat1.lz4 notHere.lz4 $FPREFIX-concat2.lz4 && exit 1 +true |