Re: [PATCH v2 16/27] t1400: Test one mistake at a time

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> This case wants to test passing a bad refname to the "update" command.
> But it also passes too few arguments to "update", which muddles the
> situation: which error should be diagnosed?  So split this test into
> two:
>
> * One that passes too few arguments to update
>
> * One that passes all three arguments to "update", but with a bad
>   refname.
>
> Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>
>
> t1400: Add a test of "update" with too few arguments
>
> Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>

What's happening here?

> ---
>  t/t1400-update-ref.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
> index 2d61cce..6b21e45 100755
> --- a/t/t1400-update-ref.sh
> +++ b/t/t1400-update-ref.sh
> @@ -724,8 +724,14 @@ test_expect_success 'stdin -z fails update with no ref' '
>  	grep "fatal: update line missing <ref>" err
>  '
>  
> +test_expect_success 'stdin -z fails update with too few args' '
> +	printf $F "update $a" "$m" >stdin &&
> +	test_must_fail git update-ref -z --stdin <stdin 2>err &&
> +	grep "fatal: update $a missing <oldvalue>" err
> +'
> +
>  test_expect_success 'stdin -z fails update with bad ref name' '
> -	printf $F "update ~a" "$m" >stdin &&
> +	printf $F "update ~a" "$m" "" >stdin &&
>  	test_must_fail git update-ref -z --stdin <stdin 2>err &&
>  	grep "fatal: invalid ref format: ~a" err
>  '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]