i18n: use test_i18ngrep and test_i18ncmp in t7502
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Apr 13, 2011 at 16:17 UTC
f79ce8dbe570f337bd638ee53c12ae9761c73c73
1 file changed
+31
-41
t/t7502-commit.sh
+31
-41
@@ -22,10 +22,7 @@ check_summary_oneline() {
22
SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
23
echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
24
25
- if test_have_prereq C_LOCALE_OUTPUT
26
- then
27
- test_cmp exp act
28
- fi
25
+ test_i18ncmp exp act
26
}
27
28
test_expect_success 'output summary format' '
@@ -234,23 +231,19 @@ echo "sample
231
# Please enter the commit message for your changes. Lines starting
232
# with '#' will be ignored, and an empty message aborts the commit." >expect
233
237
-test_expect_success C_LOCALE_OUTPUT 'cleanup commit messages (strip,-F,-e): output' '
238
- test_cmp expect actual
234
+test_expect_success 'cleanup commit messages (strip,-F,-e): output' '
235
+ test_i18ncmp expect actual
236
'
237
238
echo "#
239
# Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
240
#" >> expect
241
245
-test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
246
-
242
+test_expect_success 'author different from committer' '
243
echo >>negative &&
248
- git commit -e -m "sample"
249
- head -n 7 .git/COMMIT_EDITMSG >actual
250
-'
251
-
252
-test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '
253
- test_cmp expect actual
244
+ test_might_fail git commit -e -m "sample" &&
245
+ head -n 7 .git/COMMIT_EDITMSG >actual &&
246
+ test_i18ncmp expect actual
247
'
248
249
mv expect expect.tmp
@@ -259,7 +252,7 @@ rm -f expect.tmp
252
echo "# Committer:
253
#" >> expect
254
262
-test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
255
+test_expect_success 'committer is automatic' '
256
257
echo >>negative &&
258
(
@@ -270,10 +263,7 @@ test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
263
) &&
264
head -n 8 .git/COMMIT_EDITMSG | \
265
sed "s/^# Committer: .*/# Committer:/" >actual
273
-'
274
-
275
-test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '
276
- test_cmp expect actual
266
+ test_i18ncmp expect actual
267
'
268
269
pwd=`pwd`
@@ -376,78 +366,78 @@ try_commit () {
366
GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
367
case "$use_template" in
368
'')
379
- ! grep "^## Custom template" .git/COMMIT_EDITMSG ;;
369
+ test_i18ngrep ! "^## Custom template" .git/COMMIT_EDITMSG ;;
370
*)
381
- grep "^## Custom template" .git/COMMIT_EDITMSG ;;
371
+ test_i18ngrep "^## Custom template" .git/COMMIT_EDITMSG ;;
372
esac
373
}
374
375
try_commit_status_combo () {
376
387
- test_expect_success C_LOCALE_OUTPUT 'commit' '
377
+ test_expect_success 'commit' '
378
clear_config commit.status &&
379
try_commit "" &&
390
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
380
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
381
'
382
393
- test_expect_success C_LOCALE_OUTPUT 'commit' '
383
+ test_expect_success 'commit' '
384
clear_config commit.status &&
385
try_commit "" &&
396
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
386
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
387
'
388
399
- test_expect_success C_LOCALE_OUTPUT 'commit --status' '
389
+ test_expect_success 'commit --status' '
390
clear_config commit.status &&
391
try_commit --status &&
402
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
392
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
393
'
394
405
- test_expect_success C_LOCALE_OUTPUT 'commit --no-status' '
395
+ test_expect_success 'commit --no-status' '
396
clear_config commit.status &&
397
try_commit --no-status &&
408
- ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
398
+ test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
399
'
400
411
- test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = yes' '
401
+ test_expect_success 'commit with commit.status = yes' '
402
clear_config commit.status &&
403
git config commit.status yes &&
404
try_commit "" &&
415
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
405
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
406
'
407
418
- test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = no' '
408
+ test_expect_success 'commit with commit.status = no' '
409
clear_config commit.status &&
410
git config commit.status no &&
411
try_commit "" &&
422
- ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
412
+ test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
413
'
414
425
- test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = yes' '
415
+ test_expect_success 'commit --status with commit.status = yes' '
416
clear_config commit.status &&
417
git config commit.status yes &&
418
try_commit --status &&
429
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
419
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
420
'
421
432
- test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = yes' '
422
+ test_expect_success 'commit --no-status with commit.status = yes' '
423
clear_config commit.status &&
424
git config commit.status yes &&
425
try_commit --no-status &&
436
- ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
426
+ test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
427
'
428
439
- test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = no' '
429
+ test_expect_success 'commit --status with commit.status = no' '
430
clear_config commit.status &&
431
git config commit.status no &&
432
try_commit --status &&
443
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
433
+ test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
434
'
435
446
- test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = no' '
436
+ test_expect_success 'commit --no-status with commit.status = no' '
437
clear_config commit.status &&
438
git config commit.status no &&
439
try_commit --no-status &&
450
- ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
440
+ test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
441
'
442
443
}