From 450a4114259de82c1383a9ac31c1fc7657116386 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 7 Sep 2010 15:38:23 +0000 Subject: [PATCH] gettext tests: add GETTEXT_POISON tests for shell scripts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- t/t0205-gettext-poison.sh | 36 ++++++++++++++++++++++++++++++++++++ t/test-lib.sh | 1 + 2 files changed, 37 insertions(+) create mode 100755 t/t0205-gettext-poison.sh 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 -- 2.30.2