From: Ævar Arnfjörð Bjarmason Date: Tue, 7 Sep 2010 15:38:23 +0000 (+0000) Subject: gettext tests: add GETTEXT_POISON tests for shell scripts X-Git-Tag: ko-pu~10^2~64 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=450a4114259de82c1383a9ac31c1fc7657116386;p=git.git gettext tests: add GETTEXT_POISON tests for shell scripts Test the new GETTEXT_POISON=YesPlease support for shell scripts. This test is derived from the existing t0201-gettext-fallbacks.sh test. Signed-off-by: Ævar Arnfjörð Bjarmason --- diff --git a/t/t0205-gettext-poison.sh b/t/t0205-gettext-poison.sh new file mode 100755 index 000000000..2361590d5 --- /dev/null +++ b/t/t0205-gettext-poison.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright (c) 2010 Ævar Arnfjörð Bjarmason +# + +test_description='Gettext Shell poison' + +. ./lib-gettext.sh + +test_expect_success GETTEXT_POISON "sanity: \$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)" ' + test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME" +' + +test_expect_success GETTEXT_POISON 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is poison' ' + test "$GIT_INTERNAL_GETTEXT_SH_SCHEME" = "poison" +' + +test_expect_success GETTEXT_POISON 'gettext: our gettext() fallback has poison semantics' ' + printf "# GETTEXT POISON #" >expect && + gettext "test" >actual && + test_cmp expect actual && + printf "# GETTEXT POISON #" >expect && + gettext "test more words" >actual && + test_cmp expect actual +' + +test_expect_success GETTEXT_POISON 'eval_gettext: our eval_gettext() fallback has poison semantics' ' + printf "# GETTEXT POISON #" >expect && + eval_gettext "test" >actual && + test_cmp expect actual && + printf "# GETTEXT POISON #" >expect && + eval_gettext "test more words" >actual && + test_cmp expect actual +' + +test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index c243f0d18..11d434417 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -988,6 +988,7 @@ if test -z "$GETTEXT_POISON" then test_set_prereq NO_GETTEXT_POISON else + test_set_prereq GETTEXT_POISON GIT_INTERNAL_GETTEXT_GETTEXT_POISON=YesPlease export GIT_INTERNAL_GETTEXT_GETTEXT_POISON fi