Skip to content

Commit 8e832eb

Browse files
author
Junio C Hamano
committed
String comparison of test is done with '=', not '=='.
Caught this during a test setting /bin/sh to (d)ash. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5acc5bf commit 8e832eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/test-lib.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ test_failure_ () {
8787
say "FAIL $test_count: $1"
8888
shift
8989
echo "$@" | sed -e 's/^/ /'
90-
test "$immediate" == "" || exit 1
90+
test "$immediate" = "" || exit 1
9191
}
9292

9393

9494
test_debug () {
95-
test "$debug" == "" || eval "$1"
95+
test "$debug" = "" || eval "$1"
9696
}
9797

9898
test_expect_failure () {
99-
test "$#" == 2 ||
99+
test "$#" = 2 ||
100100
error "bug in the test script: not 2 parameters to test-expect-failure"
101101
say >&3 "expecting failure: $2"
102102
if eval >&3 2>&4 "$2"
@@ -108,7 +108,7 @@ test_expect_failure () {
108108
}
109109

110110
test_expect_success () {
111-
test "$#" == 2 ||
111+
test "$#" = 2 ||
112112
error "bug in the test script: not 2 parameters to test-expect-success"
113113
say >&3 "expecting success: $2"
114114
if eval >&3 2>&4 "$2"

0 commit comments

Comments
 (0)