]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test lib: change "error" to "BUG" as appropriate
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 9 Feb 2021 21:41:49 +0000 (22:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2021 21:54:34 +0000 (13:54 -0800)
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. 165293af3ce (tests: send "bug in the test script" errors to the
   script's stderr, 2018-11-19)

2. 30d0b6dccbc (test-lib-functions: make 'test_cmp_rev' more
   informative on failure, 2018-11-19)

3. 900721e15c4 (test-lib: introduce 'test_atexit', 2019-03-13)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib-functions.sh

index 6bca0023168c3c850f7a9129cd32e770714b4922..0d40f8a598ef94973ae5dca445c92209be25db2e 100644 (file)
@@ -1105,7 +1105,7 @@ test_cmp_rev () {
        fi
        if test $# != 2
        then
-               error "bug in the test script: test_cmp_rev requires two revisions, but got $#"
+               BUG "test_cmp_rev requires two revisions, but got $#"
        else
                local r1 r2
                r1=$(git rev-parse --verify "$1") &&
@@ -1216,7 +1216,7 @@ test_atexit () {
        # doing so on Bash is better than nothing (the test will
        # silently pass on other shells).
        test "${BASH_SUBSHELL-0}" = 0 ||
-       error "bug in test script: test_atexit does nothing in a subshell"
+       BUG "test_atexit does nothing in a subshell"
        test_atexit_cleanup="{ $*
                } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_atexit_cleanup"
 }