]> pd.if.org Git - zpackage/blobdiff - t/tap.sh
add bad file type tests to addfile test
[zpackage] / t / tap.sh
index 23c52997190d8f127cab8a8384f828d92bcf50f2..553128ffe01e9a55e5e58570acc07699f1dab1ea 100755 (executable)
--- a/t/tap.sh
+++ b/t/tap.sh
@@ -26,10 +26,11 @@ okexit() {
 }
 
 failsok() {
+       rv=$?
        note=
-       if [ $? -eq 0 ]; then
+       if [ $rv -eq 0 ]; then
                printf 'not ';
-               note=$(printf '# got "%d" expected "%d"' "$1" "0")
+               note=$(printf 'got "%d" expected "%d"' "$rv" "0")
        fi
        tn=$((tn + 1))
        printf 'ok %d - %s\n' $tn "$*"
@@ -37,8 +38,9 @@ failsok() {
 }
 
 exitwith() {
+       rv=$?
        note=
-       if [ $? -ne $1 ]; then
+       if [ $rv -ne $1 ]; then
                printf 'not ';
                note=$(printf '# got "%d" expected "%d"' "$1" "$2")
        fi