summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2006-02-13 13:06:20 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:59 +0200
commit8fad43c97c71588fa4e6dc099deddf4252a207e2 (patch)
tree0bc544f12c97a78bdef44c6b0d9b0931931629e2 /gettext-tools
parent3c26e8e28ab752cfa9776ff4b9cf3d745d9b0514 (diff)
downloadexternal_gettext-8fad43c97c71588fa4e6dc099deddf4252a207e2.zip
external_gettext-8fad43c97c71588fa4e6dc099deddf4252a207e2.tar.gz
external_gettext-8fad43c97c71588fa4e6dc099deddf4252a207e2.tar.bz2
Test that the heuristics don't mark as c-format strings that are unlikely
c-format strings.
Diffstat (limited to 'gettext-tools')
-rwxr-xr-xgettext-tools/tests/xgettext-c-1231
1 files changed, 31 insertions, 0 deletions
diff --git a/gettext-tools/tests/xgettext-c-12 b/gettext-tools/tests/xgettext-c-12
new file mode 100755
index 0000000..e8bb389
--- /dev/null
+++ b/gettext-tools/tests/xgettext-c-12
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+# Test C support: valid but unlikely C format strings are _not_ marked as
+# c-format by default.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-c-12.c"
+cat <<\EOF > xg-c-12.c
+gettext ("%1% on, %2% off");
+EOF
+
+tmpfiles="$tmpfiles xg-c-12.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --omit-header --no-location -d xg-c-12 xg-c-12.c
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-c-12.ok"
+cat <<EOF > xg-c-12.ok
+msgid "%1% on, %2% off"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-c-12.ok xg-c-12.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result