cat.tests 656 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. # Copyright 2018 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. optional FEATURE_CATV
  7. testing 'cat -e' \
  8. 'cat -e' \
  9. 'foo$\n' \
  10. '' \
  11. 'foo\n'
  12. SKIP=
  13. optional FEATURE_CATV
  14. testing 'cat -v' \
  15. 'cat -v' \
  16. 'foo\n' \
  17. '' \
  18. 'foo\n'
  19. SKIP=
  20. optional FEATURE_CATN
  21. testing 'cat -n' \
  22. 'cat -n' \
  23. "\
  24. 1 line 1
  25. 2
  26. 3 line 3
  27. " \
  28. '' \
  29. 'line 1\n\nline 3\n'
  30. SKIP=
  31. optional FEATURE_CATN
  32. testing 'cat -b' \
  33. 'cat -b' \
  34. "\
  35. 1 line 1
  36. 2 line 3
  37. " \
  38. '' \
  39. 'line 1\n\nline 3\n'
  40. SKIP=
  41. exit $FAILCOUNT