comm.tests 1.0 KB

12345678910111213141516171819
  1. #!/bin/sh
  2. # Copyright 2008 by Denys Vlasenko <vda.linux@googlemail.com>
  3. # Licensed under GPLv2, see file LICENSE in this source tree.
  4. . ./testing.sh
  5. # testing "description" "command" "result" "infile" "stdin"
  6. testing "comm test 1" "comm input -" "\t123\n""456\n""abc\n""\tdef\n" "456\nabc\n" "123\ndef\n"
  7. testing "comm test 2" "comm - input" "123\n""\t456\n""\tabc\n""def\n" "456\nabc\n" "123\ndef\n"
  8. testing "comm test 3" "comm input -" "abc\n""\tdef\n""xyz\n" "abc\nxyz\n" "def\n"
  9. testing "comm test 4" "comm - input" "\tabc\n""def\n""\txyz\n" "abc\nxyz\n" "def\n"
  10. testing "comm test 5" "comm input -" "123\n""abc\n""\tdef\n" "123\nabc\n" "def\n"
  11. testing "comm test 6" "comm - input" "\t123\n""\tabc\n""def\n" "123\nabc\n" "def\n"
  12. testing "comm unterminated line 1" "comm input -" "abc\n""\tdef\n" "abc" "def"
  13. testing "comm unterminated line 2" "comm - input" "\tabc\n""def\n" "abc" "def"
  14. exit $FAILCOUNT