Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
i18n: use test_i18ngrep and test_i18ncmp in t7502
author
Junio C Hamano
<gitster@pobox.com>
Wed, 13 Apr 2011 23:17:50 +0000
(16:17 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 13 Apr 2011 23:17:50 +0000
(16:17 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7502-commit.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
32177ba
)
diff --git
a/t/t7502-commit.sh
b/t/t7502-commit.sh
index cfb569eaba657501cf0361bee8c3f7c172ed1c06..3f3adc31b98773d26715089c25d8d923dd342717 100755
(executable)
--- a/
t/t7502-commit.sh
+++ b/
t/t7502-commit.sh
@@
-22,10
+22,7
@@
check_summary_oneline() {
SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
- if test_have_prereq C_LOCALE_OUTPUT
- then
- test_cmp exp act
- fi
+ test_i18ncmp exp act
}
test_expect_success 'output summary format' '
}
test_expect_success 'output summary format' '
@@
-234,23
+231,19
@@
echo "sample
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit." >expect
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit." >expect
-test_expect_success
C_LOCALE_OUTPUT
'cleanup commit messages (strip,-F,-e): output' '
- test_cmp expect actual
+test_expect_success 'cleanup commit messages (strip,-F,-e): output' '
+ test_
i18n
cmp expect actual
'
echo "#
# Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
#" >> expect
'
echo "#
# Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
#" >> expect
-test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
-
+test_expect_success 'author different from committer' '
echo >>negative &&
echo >>negative &&
- git commit -e -m "sample"
- head -n 7 .git/COMMIT_EDITMSG >actual
-'
-
-test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '
- test_cmp expect actual
+ test_might_fail git commit -e -m "sample" &&
+ head -n 7 .git/COMMIT_EDITMSG >actual &&
+ test_i18ncmp expect actual
'
mv expect expect.tmp
'
mv expect expect.tmp
@@
-259,7
+252,7
@@
rm -f expect.tmp
echo "# Committer:
#" >> expect
echo "# Committer:
#" >> expect
-test_expect_success
C_LOCALE_OUTPUT
'committer is automatic' '
+test_expect_success 'committer is automatic' '
echo >>negative &&
(
echo >>negative &&
(
@@
-270,10
+263,7
@@
test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
) &&
head -n 8 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual
) &&
head -n 8 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual
-'
-
-test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '
- test_cmp expect actual
+ test_i18ncmp expect actual
'
pwd=`pwd`
'
pwd=`pwd`
@@
-376,78
+366,78
@@
try_commit () {
GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
case "$use_template" in
'')
GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
case "$use_template" in
'')
-
! grep
"^## Custom template" .git/COMMIT_EDITMSG ;;
+
test_i18ngrep !
"^## Custom template" .git/COMMIT_EDITMSG ;;
*)
*)
- grep "^## Custom template" .git/COMMIT_EDITMSG ;;
+
test_i18n
grep "^## Custom template" .git/COMMIT_EDITMSG ;;
esac
}
try_commit_status_combo () {
esac
}
try_commit_status_combo () {
- test_expect_success
C_LOCALE_OUTPUT
'commit' '
+ test_expect_success 'commit' '
clear_config commit.status &&
try_commit "" &&
clear_config commit.status &&
try_commit "" &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit' '
+ test_expect_success 'commit' '
clear_config commit.status &&
try_commit "" &&
clear_config commit.status &&
try_commit "" &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --status' '
+ test_expect_success 'commit --status' '
clear_config commit.status &&
try_commit --status &&
clear_config commit.status &&
try_commit --status &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --no-status' '
+ test_expect_success 'commit --no-status' '
clear_config commit.status &&
try_commit --no-status &&
clear_config commit.status &&
try_commit --no-status &&
-
! grep
"^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18ngrep !
"^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit with commit.status = yes' '
+ test_expect_success 'commit with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
try_commit "" &&
clear_config commit.status &&
git config commit.status yes &&
try_commit "" &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit with commit.status = no' '
+ test_expect_success 'commit with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
try_commit "" &&
clear_config commit.status &&
git config commit.status no &&
try_commit "" &&
-
! grep
"^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18ngrep !
"^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --status with commit.status = yes' '
+ test_expect_success 'commit --status with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
try_commit --status &&
clear_config commit.status &&
git config commit.status yes &&
try_commit --status &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --no-status with commit.status = yes' '
+ test_expect_success 'commit --no-status with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
try_commit --no-status &&
clear_config commit.status &&
git config commit.status yes &&
try_commit --no-status &&
-
! grep
"^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18ngrep !
"^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --status with commit.status = no' '
+ test_expect_success 'commit --status with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
try_commit --status &&
clear_config commit.status &&
git config commit.status no &&
try_commit --status &&
- grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18n
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
'
- test_expect_success
C_LOCALE_OUTPUT
'commit --no-status with commit.status = no' '
+ test_expect_success 'commit --no-status with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
try_commit --no-status &&
clear_config commit.status &&
git config commit.status no &&
try_commit --no-status &&
-
! grep
"^# Changes to be committed:" .git/COMMIT_EDITMSG
+
test_i18ngrep !
"^# Changes to be committed:" .git/COMMIT_EDITMSG
'
}
'
}