Subject: Re: [PATCH/RFC 2/4] t1505: add tests for '-' notation in rev-parse

From: Torsten Bögershausen <[email-masked]>
Date: Tue, 31 Mar 2015 06:55:54 +0200

On 03/30/2015 07:41 PM, Kenny Lee Sin Cheong wrote:
> Signed-off-by: Kenny Lee Sin Cheong <[email-masked]>
> ---
>   t/t1505-rev-parse-last.sh | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
> index 4969edb..a1976ad 100755
> --- a/t/t1505-rev-parse-last.sh
> +++ b/t/t1505-rev-parse-last.sh
> @@ -33,19 +33,23 @@ test_expect_success 'setup' '
>   # and 'side' should be the last branch
>   
>   test_expect_success '@{-1} works' '
> -	test_cmp_rev side @{-1}
> +	test_cmp_rev side @{-1} &&
> +	test_cmp_rev side -
>   '
(Beside that "-" is often used for "stdin" in many unix-like tools,
and my favorite would be "-1" ):

I think the test heading should be updated as well:

test_expect_success '@{-1} or - works' '
	test_cmp_rev side @{-1} &&
	test_cmp_rev side -
  '

>   
>   test_expect_success '@{-1}~2 works' '
> -	test_cmp_rev side~2 @{-1}~2
> +	test_cmp_rev side~2 @{-1}~2 &&
> +	test_cmp_rev side~2 -~2
>   '
>   
>   test_expect_success '@{-1}^2 works' '
> -	test_cmp_rev side^2 @{-1}^2
> +	test_cmp_rev side^2 @{-1}^2 &&
> +	test_cmp_rev side^2 -^2
>   '
>   
>   test_expect_success '@{-1}@{1} works' '
> -	test_cmp_rev side@{1} @{-1}@{1}
> +	test_cmp_rev side@{1} @{-1}@{1} &&
> +	test_cmp_rev side@{1} -@{1}
>   '
>   
>   test_expect_success '@{-2} works' '