···350350 echo "No errors detected"
351351}
352352353353+# Test 7z archive interop with the 7z CLI (from p7zip). 7z has no --progress
354354+# flag, so it isn't passed here. -bso0/-bsp0 silence 7z's output/progress noise.
355355+test_7z() {
356356+ tmpdir
357357+ echo "Testing 7z in $PWD"
358358+ echo "Creating random data"
359359+ random_dir 10 indir
360360+ echo "Creating 7z archives with each tool"
361361+ 7z a -bso0 -bsp0 sevenz_archive.7z indir
362362+ cmprss 7z indir cmprss_archive.7z
363363+ echo "Extracting each archive with the opposite tool"
364364+ mkdir -p sevenz_from_cmprss
365365+ 7z x -bso0 -bsp0 "-osevenz_from_cmprss" cmprss_archive.7z
366366+ mkdir -p cmprss_from_sevenz
367367+ cmprss 7z --extract sevenz_archive.7z cmprss_from_sevenz
368368+ echo "Comparing the extracted contents"
369369+ compare indir sevenz_from_cmprss/indir
370370+ compare indir cmprss_from_sevenz/indir
371371+ echo "No errors detected"
372372+}
373373+353374# Shared helper for tar.<codec> pipeline interop. The first arg is the compound
354375# extension; the rest are the tar flags used to compress/extract that codec
355376# (e.g. `-z`, `--zstd`, or `-I lzma` for codecs without a short flag).
···390411391412# Run all the tests if no arguments are given
392413if [ $# -eq 0 ]; then
393393- set -- gzip xz bzip2 zstd lz4 lzma brotli snappy tar zip \
414414+ set -- gzip xz bzip2 zstd lz4 lzma brotli snappy tar zip 7z \
394415 tar_gz tar_xz tar_bz2 tar_zst tar_lzma tar_br tar_lz4 tar_sz
395416fi
396417