@matheusbsbs / matheus-bagliano / commits / 090850e1b0
Fork 0

remote-mediawiki tests: use test_cmp in tests

Change code that used an ad-hoc "diff -b" invocation to use our test_cmp helper instead. I'm also changing the order of arguments to be the standard "test_cmp <expected> <actual>". Using test_cmp has different semantics since the "-b" option to diff causes it to ignore whitespace, but in these cases the use of "-b" was just meaningless boilerplate. The desired semantics here are to compare "git log" lines with know-good data, so we don't want to ignore whitespace. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Sep 21, 2020 at 12:39 UTC 090850e1b03fb16fcfcd929098c6834db389faa5
1 file changed +4 -4
contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
+4 -4
@@ -28,7 +28,7 @@ test_expect_success 'Git clone creates the expected git log with one file' '
28 git log --format=%s HEAD^..HEAD >log.tmp
29 ) &&
30 echo "this must be the same" >msg.tmp &&
31 - diff -b mw_dir_1/log.tmp msg.tmp
31 + test_cmp msg.tmp mw_dir_1/log.tmp
32 '
33
34
@@ -50,8 +50,8 @@ test_expect_success 'Git clone creates the expected git log with multiple files'
50 echo "this must be the same" >>msgDaddy.tmp &&
51 echo "identical too" >msgDj.tmp &&
52 echo "identical" >>msgDj.tmp &&
53 - diff -b mw_dir_2/logDaddy.tmp msgDaddy.tmp &&
54 - diff -b mw_dir_2/logDj.tmp msgDj.tmp
53 + test_cmp msgDaddy.tmp mw_dir_2/logDaddy.tmp &&
54 + test_cmp msgDj.tmp mw_dir_2/logDj.tmp
55 '
56
57
@@ -135,7 +135,7 @@ test_expect_success 'Git clone works with one specific page cloned ' '
135 cd mw_dir_8 &&
136 echo "this log must stay" >msg.tmp &&
137 git log --format=%s >log.tmp &&
138 - diff -b msg.tmp log.tmp
138 + test_cmp msg.tmp log.tmp
139 ) &&
140 wiki_check_content mw_dir_8/Namnam.mw Namnam
141 '