Skip to content

Commit 9e9c7dd

Browse files
avargitster
authored andcommitted
test lib: change "error" to "BUG" as appropriate
Change two uses of "error" in test-lib-functions.sh to "BUG". In the first instance in "test_cmp_rev" the author of the "BUG" function added in [1] had another in-flight patch adding this in [2], and the two were never consolidated. In the second case in "test_atexit" added in [3] that we could have instead used "BUG" appears to have been missed. 1. 165293a (tests: send "bug in the test script" errors to the script's stderr, 2018-11-19) 2. 30d0b6d (test-lib-functions: make 'test_cmp_rev' more informative on failure, 2018-11-19) 3. 900721e (test-lib: introduce 'test_atexit', 2019-03-13) Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c0eedbc commit 9e9c7dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/test-lib-functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ test_cmp_rev () {
11051105
fi
11061106
if test $# != 2
11071107
then
1108-
error "bug in the test script: test_cmp_rev requires two revisions, but got $#"
1108+
BUG "test_cmp_rev requires two revisions, but got $#"
11091109
else
11101110
local r1 r2
11111111
r1=$(git rev-parse --verify "$1") &&
@@ -1216,7 +1216,7 @@ test_atexit () {
12161216
# doing so on Bash is better than nothing (the test will
12171217
# silently pass on other shells).
12181218
test "${BASH_SUBSHELL-0}" = 0 ||
1219-
error "bug in test script: test_atexit does nothing in a subshell"
1219+
BUG "test_atexit does nothing in a subshell"
12201220
test_atexit_cleanup="{ $*
12211221
} && (exit \"\$eval_ret\"); eval_ret=\$?; $test_atexit_cleanup"
12221222
}

0 commit comments

Comments
 (0)