paste.test 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. UTFTEST="$(echo -e '\xcc\xb4\xcc\x97\xcc\x9e\xcc\xa0\x65')"
  5. echo -e "one1\none2\none3" > one
  6. echo -e "two1\ntwo2\ntwo3" > two
  7. touch three four
  8. echo five > five
  9. testing "" "paste one two" "one1\ttwo1\none2\ttwo2\none3\ttwo3\n" "" ""
  10. testing "" "paste -s one two" "one1\tone2\tone3\ntwo1\ttwo2\ttwo3\n" "" ""
  11. testing "" "paste -s three four" "\n\n" "" ""
  12. testing "" "paste three four" "" "" ""
  13. testing "" "paste - - -" "uno\tdos\tdesqview\nunix\t\t\n" "" "uno\ndos\ndesqview\nunix\n"
  14. testing "" "paste - - - -d ''" "unodosdesqview\nunix\n" "" "uno\ndos\ndesqview\nunix\n"
  15. testing "" "paste one two one two" \
  16. "one1\ttwo1\tone1\ttwo1\none2\ttwo2\tone2\ttwo2\none3\ttwo3\tone3\ttwo3\n" \
  17. "" ""
  18. testing "" "paste five three two" "five\t\ttwo1\n\t\ttwo2\n\t\ttwo3\n" "" ""
  19. testing "" "paste -d '私\0${UTFTEST}q' - - - - - - " \
  20. "one私twothree${UTFTEST}fourqfive私six\n7私89${UTFTEST}q私\n" \
  21. "" "one\ntwo\nthree\nfour\nfive\nsix\n7\n8\n9\n"
  22. rm -f one two three four
  23. unset UTFTEST
  24. # test -d \n
  25. # test -d \x
  26. # test