aboutsummaryrefslogtreecommitdiffstats
path: root/echo-test
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-24 10:37:45 +0100
committerMattias Andrée <maandree@kth.se>2016-03-24 10:37:45 +0100
commit39201a315b9e8207bb3b0d912a4be2c82c04f021 (patch)
tree5bcd1d922fcddbe18fc340ff97abb3c4598572d9 /echo-test
parentm (diff)
downloadbase-util-tests-39201a315b9e8207bb3b0d912a4be2c82c04f021.tar.gz
base-util-tests-39201a315b9e8207bb3b0d912a4be2c82c04f021.tar.bz2
base-util-tests-39201a315b9e8207bb3b0d912a4be2c82c04f021.tar.xz
add echo tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'echo-test')
-rw-r--r--echo-test/11
-rw-r--r--echo-test/101
-rw-r--r--echo-test/21
-rw-r--r--echo-test/31
-rw-r--r--echo-test/41
-rw-r--r--echo-test/51
-rw-r--r--echo-test/61
-rw-r--r--echo-test/71
-rw-r--r--echo-test/81
-rw-r--r--echo-test/91
-rwxr-xr-xecho-test/test31
11 files changed, 41 insertions, 0 deletions
diff --git a/echo-test/1 b/echo-test/1
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/echo-test/1
@@ -0,0 +1 @@
+
diff --git a/echo-test/10 b/echo-test/10
new file mode 100644
index 0000000..1f4038c
--- /dev/null
+++ b/echo-test/10
@@ -0,0 +1 @@
+-e 1
diff --git a/echo-test/2 b/echo-test/2
new file mode 100644
index 0000000..7898192
--- /dev/null
+++ b/echo-test/2
@@ -0,0 +1 @@
+a
diff --git a/echo-test/3 b/echo-test/3
new file mode 100644
index 0000000..b2901ea
--- /dev/null
+++ b/echo-test/3
@@ -0,0 +1 @@
+a b
diff --git a/echo-test/4 b/echo-test/4
new file mode 100644
index 0000000..4ba2805
--- /dev/null
+++ b/echo-test/4
@@ -0,0 +1 @@
+--
diff --git a/echo-test/5 b/echo-test/5
new file mode 100644
index 0000000..7325c3e
--- /dev/null
+++ b/echo-test/5
@@ -0,0 +1 @@
+a -- c
diff --git a/echo-test/6 b/echo-test/6
new file mode 100644
index 0000000..437392a
--- /dev/null
+++ b/echo-test/6
@@ -0,0 +1 @@
+a -n b
diff --git a/echo-test/7 b/echo-test/7
new file mode 100644
index 0000000..3dad518
--- /dev/null
+++ b/echo-test/7
@@ -0,0 +1 @@
+-qwertyiopasdfghjklzxcvbnm
diff --git a/echo-test/8 b/echo-test/8
new file mode 100644
index 0000000..2255a80
--- /dev/null
+++ b/echo-test/8
@@ -0,0 +1 @@
+--help
diff --git a/echo-test/9 b/echo-test/9
new file mode 100644
index 0000000..32776d2
--- /dev/null
+++ b/echo-test/9
@@ -0,0 +1 @@
+--version
diff --git a/echo-test/test b/echo-test/test
new file mode 100755
index 0000000..dd43ea1
--- /dev/null
+++ b/echo-test/test
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+cd -- "$(dirname "$0")"
+if test -z "$ECHO"; then
+ TRUE=../echo
+fi
+e="$PREFIX $ECHO"
+N=10
+
+report ()
+{
+ if test $1 = 0; then
+ printf "\033[1;32mTest %s OK\033[m\n" "$2"
+ else
+ printf "\033[1;31mTest %s FAILED\033[m\n" "$2"
+ fi
+}
+
+if test $# = 0; then
+ set $(seq 1 $N)
+fi
+(
+for f in $@; do
+ diff <($e $(cat $f)) $f > /dev/null
+ report $? "$f"
+done
+) | tee result
+! grep FAILED < result >/dev/null
+ret=$?
+rm result
+exit $ret