aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-03-20 11:11:34 -0500
committerRob Landley <rob@landley.net>2017-03-20 11:11:34 -0500
commit2ba9c414e02197075e7e90ca077dda19fae75cda (patch)
treea2d6648aedbb5f97fe6fc5dbb02f1aa567d34ce5 /tests
parentdce1bf196a651a24056b13d09d29ac5f8fefa1cc (diff)
downloadtoybox-2ba9c414e02197075e7e90ca077dda19fae75cda.tar.gz
Rewrite paste so it actually works.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/paste.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/paste.test b/tests/paste.test
new file mode 100755
index 00000000..a6486189
--- /dev/null
+++ b/tests/paste.test
@@ -0,0 +1,18 @@
+#!/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"
+rm -f one two three four