summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPalo Kisa <palo.kisa@gmail.com>2018-12-19 09:46:15 +0100
committerPalo Kisa <palo.kisa@gmail.com>2019-01-09 10:36:05 +0000
commitee9f6ec9b9e8f0d18ad7e8fededb5292abb91912 (patch)
tree318663a881df6fbf5974058da057465ffffb2436 /tests
parent7249ba659951a9ca388a7a09cd301a2d9f79eaa4 (diff)
lupdate: Add support for parsing C++11 raw string literals
[ChangeLog][lupdate] Added support for parsing C++11 raw string literals Task-number: QTBUG-42736 Change-Id: Ia246c7e7208580182a1e0413bb38bc2c8ff3f61e Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result35
2 files changed, 57 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
index fec916ce6..dec5232fc 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
@@ -117,3 +117,25 @@ QObject::tr("Hello World");
// QTBUG-11843: complain about missing source in id-based messages
qtTrId("no_source");
+
+QObject::tr(R"(simple one)" R"delim(enter
+)delim" R"delim(with delimiter )delim inside)delim" u8R"(with quote " inside)");
+
+QLatin1String not_translated(R"(
+ This is a test string
+)");
+const char valid[] = QT_TRANSLATE_NOOP("global", R"(
+"The time has come," the Walrus said,
+"To talk of many things:
+Of shoes - and ships - and sealing-wax -
+Of cabbages - and kings -
+And why the sea is boiling hot -
+And whether pigs have wings."
+)");
+
+const QString nodelimiter(QObject::tr(R"(
+ This is a test string
+)"));
+const Qstring withdelimiter = QObject::tr(R"delim(
+This is a test string
+)delim");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
index d2f5ff29f..0710915de 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
@@ -28,6 +28,26 @@
<source>Hello World</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="main.cpp" line="121"/>
+ <source>simple oneenter
+with delimiter )delim insidewith quote &quot; inside</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="136"/>
+ <source>
+ This is a test string
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="139"/>
+ <source>
+This is a test string
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>TopLevel</name>
@@ -45,4 +65,19 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>global</name>
+ <message>
+ <location filename="main.cpp" line="127"/>
+ <source>
+&quot;The time has come,&quot; the Walrus said,
+&quot;To talk of many things:
+Of shoes - and ships - and sealing-wax -
+Of cabbages - and kings -
+And why the sea is boiling hot -
+And whether pigs have wings.&quot;
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>