summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-05-15 11:57:54 +0900
committerDaiki Ueno <ueno@gnu.org>2014-05-15 11:57:54 +0900
commit04ba4c730c81ac7bf26584cdad55b346e6308d1e (patch)
tree361bd3ab426dcbbd90039b42cb493743b8ec01ac
parentf75537b723b3c6db2b08a5d427c25b5e3ca4ed1a (diff)
downloadexternal_gettext-04ba4c730c81ac7bf26584cdad55b346e6308d1e.zip
external_gettext-04ba4c730c81ac7bf26584cdad55b346e6308d1e.tar.gz
external_gettext-04ba4c730c81ac7bf26584cdad55b346e6308d1e.tar.bz2
tests: Don't assume ga_IE locale is present
* msginit-3: Fix charset value after msginit invocation.
-rw-r--r--gettext-tools/tests/ChangeLog4
-rwxr-xr-xgettext-tools/tests/msginit-312
2 files changed, 12 insertions, 4 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index dc357f9..51dacf8 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-15 Daiki Ueno <ueno@gnu.org>
+
+ * msginit-3: Fix charset value after msginit invocation.
+
2014-05-14 Daiki Ueno <ueno@gnu.org>
tests: Fix errors when CFLAGS contains --coverage
diff --git a/gettext-tools/tests/msginit-3 b/gettext-tools/tests/msginit-3
index 7b9099b..a20f287 100755
--- a/gettext-tools/tests/msginit-3
+++ b/gettext-tools/tests/msginit-3
@@ -37,19 +37,23 @@ msgstr ""
EOF
: ${MSGINIT=msginit}
-GETTEXTLIBDIR="$abs_top_srcdir"/src ${MSGINIT} -l ga_IE.utf8 --no-translator -o mi-test3.tmp 2>mi-test3.err
+GETTEXTLIBDIR="$abs_top_srcdir"/src ${MSGINIT} -l ga_IE --no-translator -o mi-test3.tmp 2>mi-test3.err
test $? = 0 || { cat mi-test3.err 1>&2; exit 1; }
+grep -q "Project-Id-Version: gt-msginit " mi-test3.tmp || exit 1
+
+# The charset stored in the header entry is the locale encoding of the gl_IE
+# locale, which is system dependent, or ASCII if the locale does not exist.
+#
# Project-Id-Version contains version constructed from a temporary
# directory name
-grep -q "Project-Id-Version: gt-msginit " mi-test3.tmp || exit 1
-sed -e '1,10d' < mi-test3.tmp | grep -v Project-Id-Version | LC_ALL=C tr -d '\r' > mi-test3.out || exit 1
+sed -e '1,10d' -e 's/\(ISO-8859-1\|CP1252\|UTF-8\)/ASCII/g' < mi-test3.tmp | grep -v Project-Id-Version | LC_ALL=C tr -d '\r' > mi-test3.out || exit 1
cat <<\EOF > mi-test3.ok
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ga\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=ASCII\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"