aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-10-21 16:27:46 +0200
committerMattias Andrée <maandree@kth.se>2020-10-21 16:27:52 +0200
commit9846f40d461ca7515b61bd1dd9a29e71af25aa97 (patch)
tree127d3e859950313d81446306b561b381f75cecd9
parentAdd sha3sum for compatibility with busybox (-w and -s are however not support) (diff)
downloadsha3sum-9846f40d461ca7515b61bd1dd9a29e71af25aa97.tar.gz
sha3sum-9846f40d461ca7515b61bd1dd9a29e71af25aa97.tar.bz2
sha3sum-9846f40d461ca7515b61bd1dd9a29e71af25aa97.tar.xz
Update test for -z
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rwxr-xr-xtest27
1 files changed, 26 insertions, 1 deletions
diff --git a/test b/test
index 5f73f12..aa16690 100755
--- a/test
+++ b/test
@@ -156,7 +156,32 @@ set -e
test $x = 1
-## TODO add tests with -z
+printf 'dalet' > .testdir/d
+
+./sha3-224sum -z .testdir/a .testdir/b .testdir/c .testdir/d > .testdir/sums-1z
+./sha3-224sum -z .testdir/b .testdir/a .testdir/d .testdir/c > .testdir/sums-2z
+
+./sha3-224sum -cz .testdir/sums-1z
+./sha3-224sum -cz .testdir/sums-2z
+
+./sha3-224sum -cz < .testdir/sums-1z
+./sha3-224sum -cz < .testdir/sums-2z
+
+rm .testdir/d
+set +e
+./sha3-224sum -cz .testdir/sums-1z
+x=$?
+set -e
+test $x = 1
+printf '' > .testdir/d
+set +e
+./sha3-224sum -cz .testdir/sums-1z
+x=$?
+set -e
+test $x = 1
+
+! test "$(./sha3-224sum < .testdir/sums-1z)" = "$(./sha3-224sum < .testdir/sums-1)"
+test "$(./sha3-224sum < .testdir/sums-1z)" = "$(tr '\n' '\0' < .testdir/sums-1 | ./sha3-224sum)"
rm -r .testdir