File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
180180 fi
181181'
182182
183- test_expect_success C_LOCALE_OUTPUT ' reinit' '
183+ test_expect_success ' reinit' '
184184
185185 (
186186 sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
@@ -190,11 +190,11 @@ test_expect_success C_LOCALE_OUTPUT 'reinit' '
190190 git init >out1 2>err1 &&
191191 git init >out2 2>err2
192192 ) &&
193- grep "Initialized empty" again/out1 &&
194- grep "Reinitialized existing" again/out2 &&
193+ test_i18ngrep "Initialized empty" again/out1 &&
194+ test_i18ngrep "Reinitialized existing" again/out2 &&
195195 >again/empty &&
196- test_cmp again/empty again/err1 &&
197- test_cmp again/empty again/err2
196+ test_i18ncmp again/empty again/err1 &&
197+ test_i18ncmp again/empty again/err2
198198'
199199
200200test_expect_success ' init with --template' '
Original file line number Diff line number Diff line change @@ -1085,6 +1085,24 @@ test_i18ncmp () {
10851085 test -n " $GETTEXT_POISON " || test_cmp " $@ "
10861086}
10871087
1088+ # Use this instead of "grep expected-string actual" to see if the
1089+ # output from a git command that can be translated either contains an
1090+ # expected string, or does not contain an unwanted one. When running
1091+ # under GETTEXT_POISON this pretends that the command produced expected
1092+ # results.
1093+ test_i18ngrep () {
1094+ if test -n " $GETTEXT_POISON "
1095+ then
1096+ : # pretend success
1097+ elif test " x!" = " x$1 "
1098+ then
1099+ shift
1100+ ! grep " $@ "
1101+ else
1102+ grep " $@ "
1103+ fi
1104+ }
1105+
10881106# test whether the filesystem supports symbolic links
10891107ln -s x y 2> /dev/null && test -h y 2> /dev/null && test_set_prereq SYMLINKS
10901108rm -f y
You can’t perform that action at this time.
0 commit comments