t/test-lib-functions.sh: avoid "test <cond> -a/-o <cond>"
The construct is error-prone; "test" being built-in in most modern shells, the reason to avoid "test <cond> && test <cond>" spawning one extra process by using a single "test <cond> -a <cond>" no longer exists. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Jun 6, 2014 at 07:56 UTC
0cfe6fd252ee0898d832823bdab66d3cc986f3df
1 file changed
+2
-2
t/test-lib-functions.sh
+2
-2
@@ -542,7 +542,7 @@ test_must_fail () {
542
if test $exit_code = 0; then
543
echo >&2 "test_must_fail: command succeeded: $*"
544
return 1
545
- elif test $exit_code -gt 129 -a $exit_code -le 192; then
545
+ elif test $exit_code -gt 129 && test $exit_code -le 192; then
546
echo >&2 "test_must_fail: died by signal: $*"
547
return 1
548
elif test $exit_code = 127; then
@@ -569,7 +569,7 @@ test_must_fail () {
569
test_might_fail () {
570
"$@"
571
exit_code=$?
572
- if test $exit_code -gt 129 -a $exit_code -le 192; then
572
+ if test $exit_code -gt 129 && test $exit_code -le 192; then
573
echo >&2 "test_might_fail: died by signal: $*"
574
return 1
575
elif test $exit_code = 127; then