Edit

kc3-lang/brotli/tests/compatibility_test.sh

Branch :

  • Show log

    Commit

  • Author : Eugene Kliuchnikov
    Date : 2017-05-29 17:55:14
    Hash : 03739d2b
    Message : Update (#555) Update: * new CLI; bro -> brotli; + man page * JNI wrappers preparation (for bazel build) * add raw binary dictionary representation `dictionary.bin` * add ability to side-load brotli RFC dictionary * decoder persists last error now * fix `BrotliDecoderDecompress` documentation * go reader don't block until necessary * more consistent bazel target names * Java dictionary data compiled footprint reduced * Java tests refactoring

  • tests/compatibility_test.sh
  • #!/usr/bin/env bash
    #
    # Test that the brotli command-line tool can decompress old brotli-compressed
    # files.
    
    set -o errexit
    
    BROTLI=bin/brotli
    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
      $BROTLI $file -fdo $uncompressed
      diff -q $uncompressed $expected
      # Test the streaming version
      cat $file | $BROTLI -dc > $uncompressed
      diff -q $uncompressed $expected
      rm -f $uncompressed
    done