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