ar.tests 747 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # Copyright 2010 Nokia Corporation
  3. # Written by Alexander Shishkin
  4. # Licensed under GPLv2 or later, see file LICENSE in this source tree.
  5. . ./testing.sh
  6. # testing "test name" "command(s)" "expected result" "file input" "stdin"
  7. optional FEATURE_AR_CREATE
  8. rm test.a 2>/dev/null
  9. testing "ar creates archives" \
  10. "ar rc test.a README && ar p test.a README | md5sum" \
  11. "$(md5sum <README)\n" \
  12. "" \
  13. ""
  14. rm test.a 2>/dev/null
  15. testing "ar replaces things in archives" \
  16. "echo 'blah!' >file1 && echo 'blast!' >file2 && ar cr test.a README file1 file2 && mv file2 file1 && ar cr test.a file1 && ar p test.a file1" \
  17. "blast!\n" \
  18. "" \
  19. ""
  20. rm test.a file1 file1 2>/dev/null
  21. exit $FAILCOUNT