summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-04-09 19:25:58 +0900
committerDaiki Ueno <ueno@gnu.org>2014-04-15 10:58:04 +0900
commit10d925d18a1fb0203986c614540b88f321c1b4da (patch)
treefb283fde845bc4d4ff6da8cf7414dd9b57fa4048 /gettext-tools/tests
parentfd7808f5a6cec1aa43cbfe0f95ad15ee4f90d2bf (diff)
downloadexternal_gettext-10d925d18a1fb0203986c614540b88f321c1b4da.zip
external_gettext-10d925d18a1fb0203986c614540b88f321c1b4da.tar.gz
external_gettext-10d925d18a1fb0203986c614540b88f321c1b4da.tar.bz2
msgfilter: Add 'quot' and 'boldquot' built-in filters
Diffstat (limited to 'gettext-tools/tests')
-rw-r--r--gettext-tools/tests/ChangeLog6
-rw-r--r--gettext-tools/tests/Makefile.am2
-rwxr-xr-xgettext-tools/tests/msgfilter-quote-1203
3 files changed, 210 insertions, 1 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index bdca06a..6360651 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-15 Daiki Ueno <ueno@gnu.org>
+
+ tests: Add tests for 'msgfilter quot' and 'msgfilter boldquot'
+ * msgfilter-quote-1: New file.
+ * Makefile.am (TESTS): Add new tests.
+
2014-04-04 Daiki Ueno <ueno@gnu.org>
tests: Add tests for msgfmt --desktop
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 5d38255..114169b 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -42,7 +42,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
msgen-1 msgen-2 msgen-3 msgen-4 \
msgexec-1 msgexec-2 msgexec-3 msgexec-4 \
msgfilter-1 msgfilter-2 msgfilter-3 msgfilter-4 msgfilter-5 \
- msgfilter-sr-latin-1 \
+ msgfilter-sr-latin-1 msgfilter-quote-1 \
msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 msgfmt-6 msgfmt-7 \
msgfmt-8 msgfmt-9 msgfmt-10 msgfmt-11 msgfmt-12 msgfmt-13 msgfmt-14 \
msgfmt-15 msgfmt-16 msgfmt-17 \
diff --git a/gettext-tools/tests/msgfilter-quote-1 b/gettext-tools/tests/msgfilter-quote-1
new file mode 100755
index 0000000..c299641
--- /dev/null
+++ b/gettext-tools/tests/msgfilter-quote-1
@@ -0,0 +1,203 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test 'quot' and 'boldquot' filter.
+
+cat <<\EOF > mfi.po
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2014-04-10 16:40+0900\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=US-ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "\"double quoted\""
+msgstr "\"double quoted\""
+
+msgid "\"\"double quoted\""
+msgstr "\"\"double quoted\""
+
+msgid "double quoted but empty \"\""
+msgstr "double quoted but empty \"\""
+
+msgid "'single quoted'"
+msgstr "'single quoted'"
+
+msgid "prefix'single quoted without surrounding spaces'suffix"
+msgstr "prefix'single quoted without surrounding spaces'suffix"
+
+msgid "prefix 'single quoted with surrounding spaces' suffix"
+msgstr "prefix 'single quoted with surrounding spaces' suffix"
+
+msgid "single quoted with apostrophe, empty '' "
+msgstr "single quoted with apostrophe, empty '' "
+
+msgid "'single quoted at the beginning of string' "
+msgstr "'single quoted at the beginning of string' "
+
+msgid " 'single quoted at the end of string'"
+msgstr " 'single quoted at the end of string'"
+
+msgid ""
+"line 1\n"
+"'single quoted at the beginning of line' \n"
+"line 3"
+msgstr ""
+"line 1\n"
+"'single quoted at the beginning of line' \n"
+"line 3"
+
+msgid ""
+"line 1\n"
+" 'single quoted at the end of line'\n"
+"line 3"
+msgstr ""
+"line 1\n"
+" 'single quoted at the end of line'\n"
+"line 3"
+
+msgid "`single quoted with grave'"
+msgstr "`single quoted with grave'"
+
+msgid "single quoted with grave, empty `'"
+msgstr "single quoted with grave, empty `'"
+EOF
+
+: ${MSGFILTER=msgfilter}
+LC_ALL=C ${MSGFILTER} -i mfi.po -o mfi-quot.out quot 2>&1 2>/dev/null || exit 1
+
+cat <<\EOF > mfi-quot.ok
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2014-04-10 16:40+0900\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "\"double quoted\""
+msgstr "“double quoted”"
+
+msgid "\"\"double quoted\""
+msgstr "\"\"double quoted\""
+
+msgid "double quoted but empty \"\""
+msgstr "double quoted but empty \"\""
+
+msgid "'single quoted'"
+msgstr "'single quoted'"
+
+msgid "prefix'single quoted without surrounding spaces'suffix"
+msgstr "prefix'single quoted without surrounding spaces'suffix"
+
+msgid "prefix 'single quoted with surrounding spaces' suffix"
+msgstr "prefix ‘single quoted with surrounding spaces’ suffix"
+
+msgid "single quoted with apostrophe, empty '' "
+msgstr "single quoted with apostrophe, empty ‘’ "
+
+msgid "'single quoted at the beginning of string' "
+msgstr "‘single quoted at the beginning of string’ "
+
+msgid " 'single quoted at the end of string'"
+msgstr " ‘single quoted at the end of string’"
+
+msgid ""
+"line 1\n"
+"'single quoted at the beginning of line' \n"
+"line 3"
+msgstr ""
+"line 1\n"
+"‘single quoted at the beginning of line’ \n"
+"line 3"
+
+msgid ""
+"line 1\n"
+" 'single quoted at the end of line'\n"
+"line 3"
+msgstr ""
+"line 1\n"
+" ‘single quoted at the end of line’\n"
+"line 3"
+
+msgid "`single quoted with grave'"
+msgstr "‘single quoted with grave’"
+
+msgid "single quoted with grave, empty `'"
+msgstr "single quoted with grave, empty ‘’"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mfi-quot.ok mfi-quot.out || exit 1
+
+LC_ALL=C ${MSGFILTER} -i mfi.po -o mfi-boldquot.out boldquot 2>&1 2>/dev/null || exit 1
+
+cat <<\EOF > mfi-boldquot.ok
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2014-04-10 16:40+0900\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "\"double quoted\""
+msgstr "“double quoted”"
+
+msgid "\"\"double quoted\""
+msgstr "\"\"double quoted\""
+
+msgid "double quoted but empty \"\""
+msgstr "double quoted but empty \"\""
+
+msgid "'single quoted'"
+msgstr "'single quoted'"
+
+msgid "prefix'single quoted without surrounding spaces'suffix"
+msgstr "prefix'single quoted without surrounding spaces'suffix"
+
+msgid "prefix 'single quoted with surrounding spaces' suffix"
+msgstr "prefix ‘single quoted with surrounding spaces’ suffix"
+
+msgid "single quoted with apostrophe, empty '' "
+msgstr "single quoted with apostrophe, empty ‘’ "
+
+msgid "'single quoted at the beginning of string' "
+msgstr "‘single quoted at the beginning of string’ "
+
+msgid " 'single quoted at the end of string'"
+msgstr " ‘single quoted at the end of string’"
+
+msgid ""
+"line 1\n"
+"'single quoted at the beginning of line' \n"
+"line 3"
+msgstr ""
+"line 1\n"
+"‘single quoted at the beginning of line’ \n"
+"line 3"
+
+msgid ""
+"line 1\n"
+" 'single quoted at the end of line'\n"
+"line 3"
+msgstr ""
+"line 1\n"
+" ‘single quoted at the end of line’\n"
+"line 3"
+
+msgid "`single quoted with grave'"
+msgstr "‘single quoted with grave’"
+
+msgid "single quoted with grave, empty `'"
+msgstr "single quoted with grave, empty ‘’"
+EOF
+
+${DIFF} mfi-boldquot.ok mfi-boldquot.out || exit 1