summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-02-14 15:37:23 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:09:49 +0200
commitc152174caef89ae036be892422a9a5b04c9a4a93 (patch)
tree9ffeb168e5e342e2985b68c41c136aa1a67742da /gettext-tools
parent9d12f95f7472272fdaa35c988b0171d61d18b0ce (diff)
downloadexternal_gettext-c152174caef89ae036be892422a9a5b04c9a4a93.zip
external_gettext-c152174caef89ae036be892422a9a5b04c9a4a93.tar.gz
external_gettext-c152174caef89ae036be892422a9a5b04c9a4a93.tar.bz2
Move tests/msgconv-2 to gettext-tools/tests/msgconv-2.
Diffstat (limited to 'gettext-tools')
-rwxr-xr-xgettext-tools/tests/msgconv-251
1 files changed, 51 insertions, 0 deletions
diff --git a/gettext-tools/tests/msgconv-2 b/gettext-tools/tests/msgconv-2
new file mode 100755
index 0000000..93f28c8
--- /dev/null
+++ b/gettext-tools/tests/msgconv-2
@@ -0,0 +1,51 @@
+#! /bin/sh
+
+# Test conversion from UTF-8 to BIG5.
+# Test that encoding names are case insensitive.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mco-test2.po"
+cat <<\EOF > mco-test2.po
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "此功能需要恰好指定兩個輸入檔"
+EOF
+
+tmpfiles="$tmpfiles mco-test2.out"
+: ${MSGCONV=msgconv}
+${MSGCONV} -t Big5 mco-test2.po -o mco-test2.out
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles mco-test2.ok"
+cat <<\EOF > mco-test2.ok
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=BIG5\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "\ݭnnwӿJ"
+EOF
+
+: ${DIFF=diff}
+# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
+${DIFF} mco-test2.ok mco-test2.out >/dev/null
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result