>From 5450dbc7b3697c9fc3ffa32c382a75ea3d4ffdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Wed, 9 Dec 2020 15:57:14 +0100 Subject: [PATCH 1/2] tests: Add Lisp and Scheme plural cases. * gettext-tools/tests/format-lisp-2 (f-l-2.data): Add tests for goto format specifier and narrowing types on plural forms. * gettext-tools/tests/format-scheme-2 (f-sc-2.data): Likewise. Co-Authored-By: Bruno Haible --- gettext-tools/tests/format-lisp-2 | 30 +++++++++++++++++++++++++++++ gettext-tools/tests/format-scheme-2 | 30 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/gettext-tools/tests/format-lisp-2 b/gettext-tools/tests/format-lisp-2 index a3958e989..45b6b825e 100755 --- a/gettext-tools/tests/format-lisp-2 +++ b/gettext-tools/tests/format-lisp-2 @@ -168,6 +168,36 @@ msgid "abc~{~c~c~}" msgid_plural "abc~{~c~c~}" msgstr[0] "xyz~{~c~d~}" msgstr[1] "xyz~{~c~d~}" +# Valid: goto format specifier on plural forms same +msgid "~*one abc" +msgid_plural "~d abcs" +msgstr[0] "~*one abc" +msgstr[1] "~d abcs" +# Valid: goto format specifier on plural forms different +msgid "~d abc" +msgid_plural "~d abcs" +msgstr[0] "~* xyz" +msgstr[1] "~d xyz" +# Invalid: narrowing type on the translation +msgid "~a thing" +msgid_plural "~a things" +msgstr[0] "~d thing" +msgstr[1] "~d things" +# Invalid: widening type on the translation +msgid "~d thing" +msgid_plural "~d things" +msgstr[0] "~a thing" +msgstr[1] "~a things" +# Invalid: omitting an object-typed variable +msgid "~a's ~d thing" +msgid_plural "~a's ~d things" +msgstr[0] "the ~d thing" +msgstr[1] "the ~a's ~d things" +# Invalid: omitting an object-typed variable +msgid "~s ~d thing" +msgid_plural "~s ~d things" +msgstr[0] "the ~d thing" +msgstr[1] "the ~s ~d things" EOF : ${MSGFMT=msgfmt} diff --git a/gettext-tools/tests/format-scheme-2 b/gettext-tools/tests/format-scheme-2 index 5dd074511..5362e5576 100755 --- a/gettext-tools/tests/format-scheme-2 +++ b/gettext-tools/tests/format-scheme-2 @@ -183,6 +183,36 @@ msgid "abc~{~c~c~}" msgid_plural "abc~{~c~c~}" msgstr[0] "xyz~{~c~d~}" msgstr[1] "xyz~{~c~d~}" +# Valid: goto format specifier on plural forms same +msgid "~*one abc" +msgid_plural "~d abcs" +msgstr[0] "~*one abc" +msgstr[1] "~d abcs" +# Valid: goto format specifier on plural forms different +msgid "~d abc" +msgid_plural "~d abcs" +msgstr[0] "~* xyz" +msgstr[1] "~d xyz" +# Invalid: narrowing type on the translation +msgid "~a thing" +msgid_plural "~a things" +msgstr[0] "~d thing" +msgstr[1] "~d things" +# Invalid: widening type on the translation +msgid "~d thing" +msgid_plural "~d things" +msgstr[0] "~a thing" +msgstr[1] "~a things" +# Invalid: omitting an object-typed variable +msgid "~a's ~d thing" +msgid_plural "~a's ~d things" +msgstr[0] "the ~d thing" +msgstr[1] "the ~a's ~d things" +# Invalid: omitting an object-typed variable +msgid "~s ~d thing" +msgid_plural "~s ~d things" +msgstr[0] "the ~d thing" +msgstr[1] "the ~s ~d things" EOF : ${MSGFMT=msgfmt} -- 2.29.2