From 29c50fb5621db3e9492c8e73235cb8c7d2b0516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 20 May 2024 08:48:25 +0200 Subject: [PATCH] tests: add test for wrapping differences compared to gettext See #5251 and https://github.com/WeblateOrg/weblate/issues/11615 --- tests/translate/storage/test_po.py | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/translate/storage/test_po.py b/tests/translate/storage/test_po.py index cb18a238c..c3a3246b2 100644 --- a/tests/translate/storage/test_po.py +++ b/tests/translate/storage/test_po.py @@ -1046,6 +1046,42 @@ def test_wrapping_cjk(self): msgstr "" "効率的なバグの報告はPostGISの開発を助ける本質的な方法です。最も効率的なバグ報" "告は、PostGIS開発者がそれを再現できるようにすることで、それの引き金となったス" +""" + assert self.poreflow(posource) == posource + + @mark.xfail(reason="Incompatible wrapping with gettext, see #5251") + def test_wrap_emoji(self): + posource = r"""msgid "" +msgstr "Content-Type: text/plain; charset=utf-8\n" + +msgid "test" +msgstr "" +"print(ts.string_get_word_breaks(\"Test ❤️‍🔥 Test\")) # Prints [1, 2, 3, 4, 5, " +""" + assert self.poreflow(posource) == posource + + @mark.xfail(reason="Incompatible wrapping with gettext, see #5251") + def test_wrap_parenthesis(self): + posource = r"""msgid "" +msgstr "Content-Type: text/plain; charset=utf-8\n" + +msgid "test" +msgstr "" +"Konvertiert [param what] in [param type] auf die bestmögliche Weise. Der " +"[param type] verwendet die [enum Variant.Type]-Werte.\n" + +msgid "test2" +msgstr "" +"- Eine von [Object] abgeleitete Klasse, die in [ClassDB] existiert, z. B. " +"[Node].\n" + +msgid "test3" +msgstr "" +"Must be required by a NotificationListenerService, to ensure that only the " +"system can bind to it. See [url=https://developer.android.com/reference/" +"android/Manifest." +"permission#BIND_NOTIFICATION_LISTENER_SERVICE]BIND_NOTIFICATION_LISTENER_SERVICE[/" +"url]." """ assert self.poreflow(posource) == posource