1#!/usr/bin/env bash 2# 3# Test that the brotli command-line tool can decompress old brotli-compressed 4# files. 5 6set -o errexit 7 8BROTLI=bin/brotli 9TMP_DIR=bin/tmp 10 11for file in tests/testdata/*.compressed*; do 12 echo "Testing decompression of file $file" 13 expected=${file%.compressed*} 14 uncompressed=${TMP_DIR}/${expected##*/}.uncompressed 15 echo $uncompressed 16 $BROTLI $file -fdo $uncompressed 17 diff -q $uncompressed $expected 18 # Test the streaming version 19 cat $file | $BROTLI -dc > $uncompressed 20 diff -q $uncompressed $expected 21 rm -f $uncompressed 22done 23