Re: [PATCH] test-lib-functions: make 'test_cmp_rev' more informative on failure
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Nov 19, 2018, 13:31 UTC
- Message-ID
- <20181119133102.GS30222@szeder.dev>
- In-Reply-To
- <20181119132818.3116-1-szeder.dev@gmail.com>
On Mon, Nov 19, 2018 at 02:28:18PM +0100, SZEDER Gábor wrote:
Show 14 quoted lines
> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
> index d158c8d0bf..fc84db67a1 100644
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -854,9 +854,23 @@ test_must_be_empty () {
>
> # Tests that its two parameters refer to the same revision
> test_cmp_rev () {
> - git rev-parse --verify "$1" >expect.rev &&
> - git rev-parse --verify "$2" >actual.rev &&
> - test_cmp expect.rev actual.rev
> + if test $# != 2
> + then
> + error "bug in the test script: test_cmp_rev requires two revisions, but got $#"And this here is another "bug in the test script" error that should be turned into:
BUG "test_cmp_rev requires two revisions, but got $#"
See: https://public-inbox.org/git/20181119131326.2435-1-szeder.dev@gmail.com/