Edit

kc3-lang/brotli/tests/compatibility_test.sh

Branch :

  • Show log

    Commit

  • Author : Evgenii Kliuchnikov
    Date : 2016-06-24 15:32:51
    Hash : 52ff8171
    Message : Update build systems

  • tests/compatibility_test.sh
  • #!/bin/bash
    #
    # Test that the brotli command-line tool can decompress old brotli-compressed
    # files.
    
    set -o errexit
    
    BRO=bin/bro
    TMP_DIR=bin/tmp
    
    for file in tests/testdata/*.compressed*; do
      echo "Testing decompression of file $file"
      expected=${file%.compressed*}
      uncompressed=${TMP_DIR}/${expected##*/}.uncompressed
      echo $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