[PATCH 06/24] t9300 (fast-import): use test_cmp in place of test $(foo) = $(bar)

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

 



This has two benefits: it ensures that the exit status from the
output-producing commands is checked and it produces more helpful
output when the output does not match and tests are being run with -v.

Cc: Shawn O. Pearce <spearce@xxxxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 t/t9300-fast-import.sh |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index c113ddf..8d418e4 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -184,15 +184,14 @@ test_expect_success \
 test_expect_success \
 	'A: verify pack' \
 	'verify_packs'
-cat >expect <<EOF
-:000000 100755 $zeroes $file2_id A	copy-of-file2
-EOF
-git diff-tree -M -r master verify--import-marks >actual
 test_expect_success \
 	'A: verify diff' \
-	'compare_diff_raw expect actual &&
-	 test `git rev-parse --verify master:file2` \
-	    = `git rev-parse --verify verify--import-marks:copy-of-file2`'
+	'echo ":000000 100755 $zeroes $file2_id A	copy-of-file2" >expect &&
+	 echo $file2_id >expect.copy &&
+	 git diff-tree -M -r master verify--import-marks >actual &&
+	 git rev-parse --verify verify--import-marks:copy-of-file2 >actual.copy &&
+	 compare_diff_raw expect actual &&
+	 test_cmp expect.copy actual.copy'
 
 test_expect_success 'A: export marks with large values' '
 	test_tick &&
-- 
1.7.2.3

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