[PATCH 3/4] t: rev-parse-parents: avoid yoda conditions

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

 



Just as 5 == X is weird, so is comparing first the expected value, and
then the value we are testing. So switch them around.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 t/t6101-rev-parse-parents.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index c10580c..b9aef31 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -22,7 +22,7 @@ test_expect_success 'start is valid' '
 '
 
 test_expect_success 'start^0' '
-	test $(cat .git/refs/tags/start) = $(git rev-parse start^0)
+	test $(git rev-parse start^0) = $(cat .git/refs/tags/start)
 '
 
 test_expect_success 'start^1 not valid' '
@@ -34,15 +34,15 @@ test_expect_success 'second^1 = second^' '
 '
 
 test_expect_success 'final^1^1^1' '
-	test $(git rev-parse start) = $(git rev-parse final^1^1^1)
+	test $(git rev-parse final^1^1^1) = $(git rev-parse start)
 '
 
 test_expect_success 'final^1^1^1 = final^^^' '
-	test $(git rev-parse final^1^1^1) = $(git rev-parse final^^^)
+	test $(git rev-parse final^^^) = $(git rev-parse final^1^1^1)
 '
 
 test_expect_success 'final^1^2' '
-	test $(git rev-parse start2) = $(git rev-parse final^1^2)
+	test $(git rev-parse final^1^2) = $(git rev-parse start2)
 '
 
 test_expect_success 'final^1^2 != final^1^1' '
-- 
1.8.4-338-gefd7fa6

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