]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz.
authorJia Tan <jiat0218@gmail.com>
Sat, 9 Mar 2024 02:08:32 +0000 (10:08 +0800)
committerJia Tan <jiat0218@gmail.com>
Sat, 9 Mar 2024 02:08:32 +0000 (10:08 +0800)
The first stream in this file is valid, so this tests that xz properly
stops after decompressing it.

tests/test_files.sh

index 16cb8619df884a3c23e47e9e4a400d81fc780754..812b2152bd838b8033ef82185e6af786ed244920 100755 (executable)
@@ -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 #