summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 661ca02)
raw | patch | inline | side by side (parent: 661ca02)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Tue, 7 Sep 2010 15:38:23 +0000 (15:38 +0000) | ||
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sat, 30 Oct 2010 07:58:15 +0000 (07:58 +0000) |
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 <avarab@gmail.com>
test is derived from the existing t0201-gettext-fallbacks.sh test.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
t/t0205-gettext-poison.sh | [new file with mode: 0755] | patch | blob |
t/test-lib.sh | patch | blob | history |
diff --git a/t/t0205-gettext-poison.sh b/t/t0205-gettext-poison.sh
--- /dev/null
@@ -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 c243f0d18f334779a47093acabab793791f8403d..11d434417bf9420f443a0ce850e9b456cd1a7eb8 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
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