]>
Commit | Line | Data |
---|---|---|
5e9637c6 ÆAB |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2010 Ævar Arnfjörð Bjarmason | |
4 | # | |
5 | ||
6 | test_description='Gettext Shell poison' | |
7 | ||
1ff750b1 | 8 | GIT_TEST_GETTEXT_POISON=true |
6cdccfce | 9 | export GIT_TEST_GETTEXT_POISON |
5e9637c6 ÆAB |
10 | . ./lib-gettext.sh |
11 | ||
6cdccfce | 12 | test_expect_success 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is poison' ' |
5e9637c6 ÆAB |
13 | test "$GIT_INTERNAL_GETTEXT_SH_SCHEME" = "poison" |
14 | ' | |
15 | ||
6cdccfce | 16 | test_expect_success 'gettext: our gettext() fallback has poison semantics' ' |
5e9637c6 ÆAB |
17 | printf "# GETTEXT POISON #" >expect && |
18 | gettext "test" >actual && | |
19 | test_cmp expect actual && | |
20 | printf "# GETTEXT POISON #" >expect && | |
21 | gettext "test more words" >actual && | |
22 | test_cmp expect actual | |
23 | ' | |
24 | ||
6cdccfce | 25 | test_expect_success 'eval_gettext: our eval_gettext() fallback has poison semantics' ' |
5e9637c6 ÆAB |
26 | printf "# GETTEXT POISON #" >expect && |
27 | eval_gettext "test" >actual && | |
28 | test_cmp expect actual && | |
29 | printf "# GETTEXT POISON #" >expect && | |
30 | eval_gettext "test more words" >actual && | |
31 | test_cmp expect actual | |
32 | ' | |
33 | ||
1ff750b1 ÆAB |
34 | test_expect_success "gettext: invalid GIT_TEST_GETTEXT_POISON value doesn't infinitely loop" " |
35 | test_must_fail env GIT_TEST_GETTEXT_POISON=xyz git version 2>error && | |
36 | grep \"fatal: bad numeric config value 'xyz' for 'GIT_TEST_GETTEXT_POISON': invalid unit\" error | |
37 | " | |
38 | ||
5e9637c6 | 39 | test_done |