summaryrefslogtreecommitdiff
path: root/gettext-tools/tests/xgettext-c-18
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-12-24 07:38:37 +0000
committer <>2015-02-02 12:02:29 +0000
commit482840e61f86ca321838a91e902c41d40c098bbb (patch)
tree01ea2e242fd2792d19fe192476601587901db794 /gettext-tools/tests/xgettext-c-18
downloadgettext-tarball-482840e61f86ca321838a91e902c41d40c098bbb.tar.gz
Imported from /home/lorry/working-area/delta_gettext-tarball/gettext-0.19.4.tar.xz.gettext-0.19.4
Diffstat (limited to 'gettext-tools/tests/xgettext-c-18')
-rwxr-xr-xgettext-tools/tests/xgettext-c-1830
1 files changed, 30 insertions, 0 deletions
diff --git a/gettext-tools/tests/xgettext-c-18 b/gettext-tools/tests/xgettext-c-18
new file mode 100755
index 0000000..deac1f0
--- /dev/null
+++ b/gettext-tools/tests/xgettext-c-18
@@ -0,0 +1,30 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test C support: extraction of 'range:' flags.
+
+cat <<\EOF > xg-c-18.c
+if (days > 7 && days < 14)
+ /* xgettext: range: 1..6 */
+ printf (ngettext ("one week and one day", "one week and %d days",
+ days - 7),
+ days - 7);
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --omit-header --no-location -d xg-c-18.tmp xg-c-18.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-18.tmp.po > xg-c-18.po || exit 1
+
+cat <<EOF > xg-c-18.ok
+#, c-format, range: 1..6
+msgid "one week and one day"
+msgid_plural "one week and %d days"
+msgstr[0] ""
+msgstr[1] ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-c-18.ok xg-c-18.po
+result=$?
+
+exit $result