comm.test 418 B

123456789101112
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. echo -e 'a\nb\nc'> lhs
  5. for i in c d e ; do echo $i >> rhs ; done
  6. testing "comm" "comm lhs input" "a\nb\n\t\tc\n\td\n\te\n" "c\nd\ne\n" ""
  7. testing "comm -" "comm - input" "a\nb\n\t\tc\n\td\n\te\n" "c\nd\ne\n" "a\nb\nc\n"
  8. testing "comm -123 detects missing" "comm - missing 2>/dev/null || echo here" \
  9. "here\n" "" ""