Also test basic integrity with --force

This commit is contained in:
Andrew Wood
2023-07-25 21:21:02 +01:00
parent 7794df7182
commit 678f655116
+15 -3
View File
@@ -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