Skip to content

Commit 090850e

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 128efae commit 090850e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/mw-to-git/t/t9360-mw-to-git-clone.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_expect_success 'Git clone creates the expected git log with one file' '
2828
git log --format=%s HEAD^..HEAD >log.tmp
2929
) &&
3030
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
3232
'
3333

3434

@@ -50,8 +50,8 @@ test_expect_success 'Git clone creates the expected git log with multiple files'
5050
echo "this must be the same" >>msgDaddy.tmp &&
5151
echo "identical too" >msgDj.tmp &&
5252
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
5555
'
5656

5757

@@ -135,7 +135,7 @@ test_expect_success 'Git clone works with one specific page cloned ' '
135135
cd mw_dir_8 &&
136136
echo "this log must stay" >msg.tmp &&
137137
git log --format=%s >log.tmp &&
138-
diff -b msg.tmp log.tmp
138+
test_cmp msg.tmp log.tmp
139139
) &&
140140
wiki_check_content mw_dir_8/Namnam.mw Namnam
141141
'

0 commit comments

Comments
 (0)