From 9846f40d461ca7515b61bd1dd9a29e71af25aa97 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 21 Oct 2020 16:27:46 +0200 Subject: Update test for -z MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.3-70-g09d2