From 1a6b9937b00a3d60dedc5ace1a72f9aaf92d9b25 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 8 Nov 2017 21:17:52 +0100 Subject: add test suite --- t/zecho.t | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 t/zecho.t (limited to 't/zecho.t') 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 -- cgit 1.4.1