From 678f6551163e8cac0a5afaff9f8bfe5505fd462a Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 25 Jul 2023 21:21:02 +0100 Subject: [PATCH] Also test basic integrity with --force --- tests/Integrity_-_Basic.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/Integrity_-_Basic.sh b/tests/Integrity_-_Basic.sh index 3524cff..a8ee91b 100644 --- a/tests/Integrity_-_Basic.sh +++ b/tests/Integrity_-_Basic.sh @@ -8,8 +8,20 @@ testSubject="${testSubject:-false}" inputString="TESTING" outputString=$(printf "%s" "${inputString}" | "${testSubject}" 2>/dev/null) || { echo "unexpected failure code"; exit 1; } -test "${inputString}" = "${outputString}" && exit 0 -echo "output did not match input" -exit 1 +if ! test "${inputString}" = "${outputString}"; then + echo "output did not match input" + exit 1 +fi + +# Test again with --force. +inputString="TESTINGAGAIN" +outputString=$(printf "%s" "${inputString}" | "${testSubject}" -f 2>/dev/null) || { echo "unexpected failure code"; exit 1; } + +if ! test "${inputString}" = "${outputString}"; then + echo "output did not match input when using --force" + exit 1 +fi + +exit 0 # EOF