about summary refs log tree commit diff
path: root/t/zecho.t
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-11-08 21:17:52 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-11-08 21:17:52 +0100
commit1a6b9937b00a3d60dedc5ace1a72f9aaf92d9b25 (patch)
tree28aa1d3bda8f8e0e74fe8a6daa7bc3afcd539bf5 /t/zecho.t
parent8e785f07f4fde9fb3aeb34cbcb93eb188c56b1f6 (diff)
downloadnecho-1a6b9937b00a3d60dedc5ace1a72f9aaf92d9b25.tar.gz
necho-1a6b9937b00a3d60dedc5ace1a72f9aaf92d9b25.tar.xz
necho-1a6b9937b00a3d60dedc5ace1a72f9aaf92d9b25.zip
add test suite
Diffstat (limited to 't/zecho.t')
-rwxr-xr-xt/zecho.t46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/zecho.t b/t/zecho.t
new file mode 100755
index 0000000..dc2b00b
--- /dev/null
+++ b/t/zecho.t
@@ -0,0 +1,46 @@
+#!/bin/sh
+export "PATH=.:t:$PATH"
+
+printf '1..6\n'
+printf '# zecho\n'
+
+tap3 "single string" <<'EOF'
+zecho hello | tr '\000\012X' '\012X'
+>>>
+hello
+EOF
+
+tap3 "two strings" <<'EOF'
+zecho hello random | tr '\000\012X' '\012X'
+>>>
+hello
+random
+EOF
+
+tap3 "no arguments" <<'EOF'
+zecho | tr '\000\012X' '\012X'
+>>>
+EOF
+
+tap3 "empty argument" <<'EOF'
+zecho foo '' bar | tr '\000\012X' '\012X'
+>>>
+foo
+
+bar
+EOF
+
+tap3 "string with minus" <<'EOF'
+zecho -n -e | tr '\000\012X' '\012X'
+>>>
+-n
+-e
+EOF
+
+tap3 "string with double minus" <<'EOF'
+zecho -n -- -e | tr '\000\012X' '\012X'
+>>>
+-n
+--
+-e
+EOF