test: use test_i18ncmp when checking --stat output
Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line produced by "git apply --stat", "git diff --stat", and "git commit" varies by locale, producing test failures when GETTEXT_POISON is set. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Mar 12, 2012 at 23:54 UTC
fc5877a6231aca01b63ddfd507bc1180078c09e2
8 files changed
+16
-16
t/t3300-funny-names.sh
+3
-3
@@ -174,7 +174,7 @@ EOF
174
test_expect_success TABS_IN_FILENAMES 'git diff-tree rename with-funny applied' \
175
'git diff-index -M -p $t0 |
176
git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
177
- test_cmp expected current'
177
+ test_i18ncmp expected current'
178
179
test_expect_success TABS_IN_FILENAMES 'setup expect' '
180
cat > expected <<\EOF
@@ -187,12 +187,12 @@ EOF
187
test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny applied' \
188
'git diff-index -p $t0 |
189
git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
190
- test_cmp expected current'
190
+ test_i18ncmp expected current'
191
192
test_expect_success TABS_IN_FILENAMES 'git apply non-git diff' \
193
'git diff-index -p $t0 |
194
sed -ne "/^[-+@]/p" |
195
git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
196
- test_cmp expected current'
196
+ test_i18ncmp expected current'
197
198
test_done
t/t3508-cherry-pick-many-commits.sh
+2
-2
@@ -55,7 +55,7 @@ test_expect_success 'cherry-pick first..fourth works' '
55
git diff --quiet HEAD other &&
56
57
sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
58
- test_cmp expected actual.fuzzy &&
58
+ test_i18ncmp expected actual.fuzzy &&
59
check_head_differs_from fourth
60
'
61
@@ -82,7 +82,7 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
82
git diff --quiet other &&
83
git diff --quiet HEAD other &&
84
sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
85
- test_cmp expected actual.fuzzy &&
85
+ test_i18ncmp expected actual.fuzzy &&
86
check_head_differs_from fourth
87
'
88
t/t3903-stash.sh
+2
-2
@@ -447,7 +447,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '
447
1 file changed, 1 insertion(+)
448
EOF
449
git stash show ${STASH_ID} >actual &&
450
- test_cmp expected actual
450
+ test_i18ncmp expected actual
451
'
452
453
test_expect_success 'stash show -p - stashes on stack, stash-like argument' '
@@ -485,7 +485,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '
485
1 file changed, 1 insertion(+)
486
EOF
487
git stash show ${STASH_ID} >actual &&
488
- test_cmp expected actual
488
+ test_i18ncmp expected actual
489
'
490
491
test_expect_success 'stash show -p - no stashes on stack, stash-like argument' '
t/t4012-diff-binary.sh
+2
-2
@@ -25,11 +25,11 @@ cat > expected <<\EOF
25
EOF
26
test_expect_success 'diff without --binary' \
27
'git diff | git apply --stat --summary >current &&
28
- test_cmp expected current'
28
+ test_i18ncmp expected current'
29
30
test_expect_success 'diff with --binary' \
31
'git diff --binary | git apply --stat --summary >current &&
32
- test_cmp expected current'
32
+ test_i18ncmp expected current'
33
34
# apply needs to be able to skip the binary material correctly
35
# in order to report the line number of a corrupt patch.
t/t4049-diff-stat-count.sh
+1
-1
@@ -19,7 +19,7 @@ test_expect_success setup '
19
2 files changed, 2 insertions(+)
20
EOF
21
git diff --stat --stat-count=2 >actual &&
22
- test_cmp expect actual
22
+ test_i18ncmp expect actual
23
'
24
25
test_done
t/t4100-apply-stat.sh
+2
-2
@@ -17,13 +17,13 @@ do
17
test_expect_success "$title" '
18
git apply --stat --summary \
19
<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
20
- test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
20
+ test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
21
'
22
23
test_expect_success "$title with recount" '
24
sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
25
git apply --recount --stat --summary >current &&
26
- test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
26
+ test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
27
'
28
done <<\EOF
29
rename
t/t5150-request-pull.sh
+1
-1
@@ -216,7 +216,7 @@ test_expect_success 'pull request format' '
216
git request-pull initial "$downstream_url" >../request
217
) &&
218
<request sed -nf fuzz.sed >request.fuzzy &&
219
- test_cmp expect request.fuzzy
219
+ test_i18ncmp expect request.fuzzy
220
221
'
222
t/t7602-merge-octopus-many.sh
+3
-3
@@ -66,7 +66,7 @@ EOF
66
test_expect_success 'merge output uses pretty names' '
67
git reset --hard c1 &&
68
git merge c2 c3 c4 >actual &&
69
- test_cmp actual expected
69
+ test_i18ncmp expected actual
70
'
71
72
cat >expected <<\EOF
@@ -80,7 +80,7 @@ EOF
80
81
test_expect_success 'merge up-to-date output uses pretty names' '
82
git merge c4 c5 >actual &&
83
- test_cmp actual expected
83
+ test_i18ncmp expected actual
84
'
85
86
cat >expected <<\EOF
@@ -97,7 +97,7 @@ EOF
97
test_expect_success 'merge fast-forward output uses pretty names' '
98
git reset --hard c0 &&
99
git merge c1 c2 >actual &&
100
- test_cmp actual expected
100
+ test_i18ncmp expected actual
101
'
102
103
test_done