From: Mischa POSLAWSKY Date: Fri, 4 Oct 2019 03:15:51 +0000 (+0200) Subject: t: filename shorthand '_?' to compare exit code X-Git-Tag: v1.07~24 X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/704f0f343df103c321caa2ea7e846dea650cd24e t: filename shorthand '_?' to compare exit code Make it easier to check for non-zero $? by replacing ' |[ $? = N ]' by ' ?N' for same results with minimal clutter. --- diff --git a/t/regress.t b/t/regress.t index 6a95a9f..5911e25 100755 --- a/t/regress.t +++ b/t/regress.t @@ -37,6 +37,7 @@ do [ -r "$input" ] && set -- "$@" "$input" case "$name" in *\ -*) set -- "$@" -"${name#* -}";; esac case "$name" in + *' ?'*) set -- sh -c "\$0 \$1 | test \$\? = ${name#* \?}" "$@";; *' |'*) set -- sh -c "\$0 \$1 | ${name#* |}" "$@";; *) set -- "$1" $2 $3 esac diff --git a/t/t0003-invalid_options_-aZ_|[_$?_=_64_].out b/t/t0003-invalid_options_-aZ_?64.out similarity index 100% rename from t/t0003-invalid_options_-aZ_|[_$?_=_64_].out rename to t/t0003-invalid_options_-aZ_?64.out