Re: [PATCH v4 29/36] hook tests: use a modern style for "pre-push" tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 03, 2021 at 09:38:55PM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
> Indent the here-docs and use "test_cmp" instead of "diff" in tests
> added in ec55559f937 (push: Add support for pre-push hooks,
> 2013-01-13). Let's also use the more typical "expect" instead of
> "expected" to be consistent with the rest of the test file.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
> ---
>  t/t5571-pre-push-hook.sh | 71 ++++++++++++++++++++--------------------
>  1 file changed, 35 insertions(+), 36 deletions(-)
> 
> diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
> index d2857a6fbc0..6d0d5b854ea 100755
> --- a/t/t5571-pre-push-hook.sh
> +++ b/t/t5571-pre-push-hook.sh
> @@ -61,15 +61,15 @@ echo "$2" >>actual
>  cat >>actual
>  EOF
>  
> -cat >expected <<EOF
> -parent1
> -repo1
> -refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
> -EOF
> -
>  test_expect_success 'push with hook' '
> +	cat >expected <<-EOF &&
> +	parent1
> +	repo1
> +	refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
> +	EOF
> +
>  	git push parent1 main:foreign &&
> -	diff expected actual
> +	test_cmp expected actual

Your commit message tells me you're getting rid of 'expected', but here
it is. Should that just be 'expect'?

Otherwise it looks fine.

Reviewed-by: Emily Shaffer <emilyshaffer@xxxxxxxxxx>



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux