]> pd.if.org Git - zpackage/blobdiff - t/tap.sh
fix bug in tap exit with, add diag
[zpackage] / t / tap.sh
index 59df961a207547397e0719816096d61fe67f6de8..b82f203f5f7628cbdaca6d46d46974a2431ba826 100755 (executable)
--- a/t/tap.sh
+++ b/t/tap.sh
@@ -35,6 +35,10 @@ shownote() {
        fi
 }
 
+diag() {
+       printf '# %s\n' "$@"
+}
+
 okexit() {
        exitwith 0 "$*"
 }
@@ -56,7 +60,7 @@ exitwith() {
        note=
        if [ $rv -ne $1 ]; then
                printf 'not ';
-               note=$(printf '# got "%d" expected "%d"' "$1" "$2")
+               note=$(printf '# got "%d" expected "%d"' "$rv" "$1")
        fi
        shift
        tn=$((tn + 1))