aboutsummaryrefslogtreecommitdiffstats
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
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 '')
-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
-rwxr-xr-xtest-all2
12 files changed, 42 insertions, 1 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
diff --git a/test-all b/test-all
index 0a769ce..99d6178 100755
--- a/test-all
+++ b/test-all
@@ -6,7 +6,7 @@ function all()
{
echo patch md5sum rawshake256sum rawshake512sum sha1sum sha224sum sha256sum sha3-224sum \
sha3-256sum sha3-384sum sha3-512sum sha384sum sha512-224sum sha512-256sum sha512sum \
- shake256sum shake512sum true false
+ shake256sum shake512sum true false echo
}
if test -n "${IN_PATH}"; then