3 # Copyright (c) 2010 Ævar Arnfjörð Bjarmason
6 test_description
='Gettext Shell fallbacks'
8 GIT_INTERNAL_GETTEXT_TEST_FALLBACKS
=YesPlease
9 export GIT_INTERNAL_GETTEXT_TEST_FALLBACKS
13 test_expect_success
"sanity: \$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)" '
14 test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME"
17 test_expect_success
'sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set' '
18 test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
21 test_expect_success
'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is fallthrough' '
22 echo fallthrough >expect &&
23 echo $GIT_INTERNAL_GETTEXT_SH_SCHEME >actual &&
24 test_cmp expect actual
27 test_expect_success
'gettext: our gettext() fallback has pass-through semantics' '
28 printf "test" >expect &&
29 gettext "test" >actual &&
30 test_cmp expect actual &&
31 printf "test more words" >expect &&
32 gettext "test more words" >actual &&
33 test_cmp expect actual
36 test_expect_success
'eval_gettext: our eval_gettext() fallback has pass-through semantics' '
37 printf "test" >expect &&
38 eval_gettext "test" >actual &&
39 test_cmp expect actual &&
40 printf "test more words" >expect &&
41 eval_gettext "test more words" >actual &&
42 test_cmp expect actual
45 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables' '
46 printf "test YesPlease" >expect &&
47 GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease eval_gettext "test \$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" >actual &&
48 test_cmp expect actual
51 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces' '
54 printf "When you have resolved this problem, run git am --resolved." >expect &&
55 eval_gettext "When you have resolved this problem, run \$cmdline --resolved." >actual &&
56 test_cmp expect actual
59 test_expect_success
'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '
62 printf "When you have resolved this problem, run \"git am --resolved\"." >expect &&
63 eval_gettext "When you have resolved this problem, run \"\$cmdline --resolved\"." >actual &&
64 test_cmp expect actual