[PATCH 06/24] t9300 (fast-import): use test_cmp in place of test $(foo) = $(bar)
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 24, 2010, 07:12 UTC
- Message-ID
- <20100924071237.GG4666@burratino>
- In-Reply-To
- <20100924065900.GA4666@burratino>
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@spearce.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- 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