From 65deb9f7dd23b2108655e6c7cb597defbce8a7ed Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 30 Jul 2025 19:11:26 +0200 Subject: [PATCH] sha3sum: add -aBITS tests Signed-off-by: Denys Vlasenko --- testsuite/md5sum.tests | 6 +++--- testsuite/sha3sum.tests | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testsuite/md5sum.tests b/testsuite/md5sum.tests index 634dcd4aa..a6d2b7ffb 100755 --- a/testsuite/md5sum.tests +++ b/testsuite/md5sum.tests @@ -32,9 +32,9 @@ text=`yes "$text" | head -c 9999` result=`( n=0 while test $n -le 999; do - echo "$text" | head -c $n | "$sum" + echo "$text" | head -c $n | $sum n=$(($n+1)) -done | "$sum" +done | $sum )` if test x"$result" != x"$expected -"; then echo "FAIL: $sum (r:$result exp:$expected)" @@ -45,7 +45,7 @@ fi # GNU compat: -c EMPTY must fail (exitcode 1)! >EMPTY -if "$sum" -c EMPTY 2>/dev/null; then +if $sum -c EMPTY 2>/dev/null; then echo "FAIL: $sum -c EMPTY" : $((FAILCOUNT++)) else diff --git a/testsuite/sha3sum.tests b/testsuite/sha3sum.tests index 2cd8e3bf2..631141735 100755 --- a/testsuite/sha3sum.tests +++ b/testsuite/sha3sum.tests @@ -1,3 +1,7 @@ #!/bin/sh -. ./md5sum.tests sha3sum 11659f09370139f8ef384f4a6260947fafa6e4fcd87a1ef3f35410e9 + (. ./md5sum.tests sha3sum 11659f09370139f8ef384f4a6260947fafa6e4fcd87a1ef3f35410e9) \ +&& (. ./md5sum.tests "sha3sum -a224" 11659f09370139f8ef384f4a6260947fafa6e4fcd87a1ef3f35410e9) \ +&& (. ./md5sum.tests "sha3sum -a256" 6f69c8d36a9a579a943d878dab38c179d2a9dde12b244aa8840002c0f3d5bb73) \ +&& (. ./md5sum.tests "sha3sum -a384" 303913449042257996a869e0378323193b4f58d90eea801b12186a3d65640bd3403d3404c63527424ec43dff842c0cd0) \ +&& (. ./md5sum.tests "sha3sum -a512" e14814dccc2fef967af74eb6710885b35dfe660a362c0609b642404987d24a13dac66ad037e6affa5c42631110231655fcf4c972b1457ac49fb83af8113fc51f)