From: Jia Tan Date: Sat, 9 Mar 2024 02:08:32 +0000 (+0800) Subject: Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz. X-Git-Tag: v5.7.1alpha~441 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3a29bbd;p=thirdparty%2Fxz.git Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz. The first stream in this file is valid, so this tests that xz properly stops after decompressing it. --- diff --git a/tests/test_files.sh b/tests/test_files.sh index 16cb8619..812b2152 100755 --- a/tests/test_files.sh +++ b/tests/test_files.sh @@ -149,6 +149,17 @@ else exit 1 fi +# Test that --single-stream can decompress bad-3-corrupt_lzma2.xz. +# The first Stream in this file should decompress without errors. +# This file cannot be decompressed with xzdec. +I="$srcdir/files/bad-3-corrupt_lzma2.xz" +if test -z "$XZ" || "$XZ" -dc --single-stream $NO_WARN "$I" > /dev/null; then + : +else + echo "Good first Stream failed xz with --single-stream: $I" + exit 1 +fi + ######### # .lzma #