summaryrefslogtreecommitdiff
path: root/gettext-tools/tests
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-14 02:41:27 +0100
committerBruno Haible <bruno@clisp.org>2023-03-14 02:57:28 +0100
commitbb57c7637a04ce5f980c71cb42b1b5ef089a3a0f (patch)
treecedfa90297f4d82dba5f6a79021dcda100302081 /gettext-tools/tests
parent85d4cb991e6a8c111d0739c343bba22143c094d6 (diff)
downloadgettext-bb57c7637a04ce5f980c71cb42b1b5ef089a3a0f.tar.gz
lisp-format, scheme-format: Fix a loop transformation.
* gettext-tools/src/format-lisp.c (rotate_loop): Assign the new list->repeated.count. * gettext-tools/src/format-scheme.c (rotate_loop): Likewise. * gettext-tools/tests/xgettext-lisp-6: New file. * gettext-tools/tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'gettext-tools/tests')
-rw-r--r--gettext-tools/tests/Makefile.am2
-rwxr-xr-xgettext-tools/tests/xgettext-lisp-624
2 files changed, 25 insertions, 1 deletions
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 2edb31138..0da888ab1 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -122,7 +122,7 @@ TESTS = gettext-1 gettext-2 \
xgettext-librep-1 xgettext-librep-2 xgettext-librep-3 \
xgettext-librep-stackovfl-1 xgettext-librep-stackovfl-2 \
xgettext-lisp-1 xgettext-lisp-2 xgettext-lisp-3 xgettext-lisp-4 \
- xgettext-lisp-5 \
+ xgettext-lisp-5 xgettext-lisp-6 \
xgettext-lisp-stackovfl-1 xgettext-lisp-stackovfl-2 \
xgettext-lua-1 xgettext-lua-2 xgettext-lua-3 \
xgettext-lua-stackovfl-1 xgettext-lua-stackovfl-2 \
diff --git a/gettext-tools/tests/xgettext-lisp-6 b/gettext-tools/tests/xgettext-lisp-6
new file mode 100755
index 000000000..bcfbff7d6
--- /dev/null
+++ b/gettext-tools/tests/xgettext-lisp-6
@@ -0,0 +1,24 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Lisp support: lisp-format string with initial arguments and a loop.
+
+cat <<EOF > xg-ls-6.lisp
+(gettext "~{~}~^~:*~@{~,v*~w~}")
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --omit-header --no-location -d xg-ls-6.tmp xg-ls-6.lisp || Exit 1
+LC_ALL=C tr -d '\r' < xg-ls-6.tmp.po > xg-ls-6.po || Exit 1
+
+cat <<EOF > xg-ls-6.ok
+#, lisp-format
+msgid "~{~}~^~:*~@{~,v*~w~}"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-ls-6.ok xg-ls-6.po
+result=$?
+
+exit $result