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

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

 



On 03/30/2015 07:41 PM, Kenny Lee Sin Cheong wrote:
Signed-off-by: Kenny Lee Sin Cheong <kenny.lee28@xxxxxxxxx>
---
  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' '

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