summaryrefslogtreecommitdiffstats
path: root/debian/vendor-h2o/deps/brotli/tests/compatibility_test.sh
blob: e907485e140d51e966d62c69b287f814778ec9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#
# Test that the brotli command-line tool can decompress old brotli-compressed
# files.

set -o errexit

BRO=../tools/bro

for file in testdata/*.compressed*; do
  echo "Testing decompression of file $file"
  expected=${file%.compressed*}
  uncompressed=${expected}.uncompressed
  $BRO -f -d -i $file -o $uncompressed
  diff -q $uncompressed $expected
  # Test the streaming version
  cat $file | $BRO -d > $uncompressed
  diff -q $uncompressed $expected
  rm -f $uncompressed
done