test-apt-helper-cat-file 613 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. cat >rootdir/etc/apt/apt.conf.d/rev-as-compressor <<EOF
  7. APT::Compressor::rev {
  8. Name "rev";
  9. Extension ".rev";
  10. Binary "rev";
  11. Cost "1";
  12. };
  13. EOF
  14. configcompression 'ALL'
  15. cat >./test.txt <<EOF
  16. This is a test.
  17. EOF
  18. compressfile ./test.txt
  19. while read compressor extension command; do
  20. if [ "$compressor" = '.' ]; then
  21. FILE='./test.txt'
  22. else
  23. FILE="./test.txt.${extension}"
  24. fi
  25. testsuccessequal "$(cat ./test.txt)" apthelper cat-file "$FILE"
  26. done < "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf"