mirror of
https://github.com/git/git.git
synced 2026-04-11 17:30:08 +02:00
Merge branch 'ab/i18n-scripts-basic'
* ab/i18n-scripts-basic: Makefile: add xgettext target for *.sh files git-sh-i18n.sh: add GIT_GETTEXT_POISON support git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()
This commit is contained in:
51
t/t0201-gettext-fallbacks.sh
Executable file
51
t/t0201-gettext-fallbacks.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
|
||||
#
|
||||
|
||||
test_description='Gettext Shell fallbacks'
|
||||
|
||||
. ./test-lib.sh
|
||||
. "$GIT_BUILD_DIR"/git-sh-i18n
|
||||
|
||||
test_expect_success 'gettext: our gettext() fallback has pass-through semantics' '
|
||||
printf "test" >expect &&
|
||||
gettext "test" >actual &&
|
||||
test_i18ncmp expect actual &&
|
||||
printf "test more words" >expect &&
|
||||
gettext "test more words" >actual &&
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'eval_gettext: our eval_gettext() fallback has pass-through semantics' '
|
||||
printf "test" >expect &&
|
||||
eval_gettext "test" >actual &&
|
||||
test_i18ncmp expect actual &&
|
||||
printf "test more words" >expect &&
|
||||
eval_gettext "test more words" >actual &&
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables' '
|
||||
printf "test YesPlease" >expect &&
|
||||
GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease eval_gettext "test \$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" >actual &&
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces' '
|
||||
cmdline="git am" &&
|
||||
export cmdline;
|
||||
printf "When you have resolved this problem run git am --resolved." >expect &&
|
||||
eval_gettext "When you have resolved this problem run \$cmdline --resolved." >actual
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '
|
||||
cmdline="git am" &&
|
||||
export cmdline;
|
||||
printf "When you have resolved this problem run \"git am --resolved\"." >expect &&
|
||||
eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\"." >actual
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
Reference in New Issue
Block a user