3 # Copyright (c) 2010 Ævar Arnfjörð Bjarmason
6 test_description
='Gettext Shell fallbacks'
9 .
"$GIT_BUILD_DIR"/git-sh-i18n
11 test_expect_success
'gettext: our gettext() fallback has pass-through semantics' '
12 printf "test" >expect &&
13 gettext "test" >actual &&
14 test_i18ncmp expect actual &&
15 printf "test more words" >expect &&
16 gettext "test more words" >actual &&
17 test_i18ncmp expect actual
20 test_expect_success
'eval_gettext: our eval_gettext() fallback has pass-through semantics' '
21 printf "test" >expect &&
22 eval_gettext "test" >actual &&
23 test_i18ncmp expect actual &&
24 printf "test more words" >expect &&
25 eval_gettext "test more words" >actual &&
26 test_i18ncmp expect actual
29 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables' '
30 printf "test YesPlease" >expect &&
31 GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease eval_gettext "test \$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" >actual &&
32 test_i18ncmp expect actual
35 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces' '
38 printf "When you have resolved this problem run git am --resolved." >expect &&
39 eval_gettext "When you have resolved this problem run \$cmdline --resolved." >actual
40 test_i18ncmp expect actual
43 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '
46 printf "When you have resolved this problem run \"git am --resolved\"." >expect &&
47 eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\"." >actual
48 test_i18ncmp expect actual