aboutsummaryrefslogtreecommitdiff
path: root/tests/paste.test
blob: c067f1829ba1eba6ea18e8d05fde3f4934284703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testing "name" "command" "result" "infile" "stdin"

UTFTEST="$(echo -e '\xcc\xb4\xcc\x97\xcc\x9e\xcc\xa0\x65')"
echo -e "one1\none2\none3" > one
echo -e "two1\ntwo2\ntwo3" > two
touch three four
echo five > five
testing "" "paste one two" "one1\ttwo1\none2\ttwo2\none3\ttwo3\n" "" ""
testing "" "paste -s one two" "one1\tone2\tone3\ntwo1\ttwo2\ttwo3\n" "" ""
testing "" "paste -s three four" "\n\n" "" ""
testing "" "paste three four" "" "" ""
testing "" "paste - - -" "uno\tdos\tdesqview\nunix\t\t\n" "" "uno\ndos\ndesqview\nunix\n"
testing "" "paste - - - -d ''" "unodosdesqview\nunix\n" "" "uno\ndos\ndesqview\nunix\n"
testing "" "paste one two one two" \
  "one1\ttwo1\tone1\ttwo1\none2\ttwo2\tone2\ttwo2\none3\ttwo3\tone3\ttwo3\n" \
  "" ""
testing "" "paste five three two" "five\t\ttwo1\n\t\ttwo2\n\t\ttwo3\n" "" ""
testing "" "paste -d '私\0${UTFTEST}q' - - - - - - " \
  "one私twothree${UTFTEST}fourqfive私six\n7私89${UTFTEST}q私\n" \
  "" "one\ntwo\nthree\nfour\nfive\nsix\n7\n8\n9\n"
rm -f one two three four
unset UTFTEST

# test -d \n
# test -d \x
# test