aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml35
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp11
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml
new file mode 100644
index 0000000000..1ae1b162b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml
@@ -0,0 +1,35 @@
+import QtQuick 2.0
+
+Item {
+ id: root;
+ property bool test: str == str2 && (txt != null && txt.str == root.str)
+ property Text txt: null
+ //Constant doesn't hit rewriter
+ property string str: 'same
+multiline
+string 5 !'
+ property string str2: '';
+ Component {
+ id: comp
+ Text {
+ property var value: 1
+ property string str: 'same
+multiline
+string ' + value + " !"
+ Component.onCompleted: { //Separate codepath for signal handers in rewriter
+ root.str2 = 'same
+multiline
+string ' + value + " !"
+ }
+ }
+ }
+ Component.onCompleted: txt = comp.createObject(root,{"value" : 5})
+ /*
+ Timer {
+ interval: 1000
+ running: true
+ repeat: true
+ onTriggered: console.debug( "Test: " + test + '\n' + str + '\n:\n' + str2 + "\n:\n" + txt.str)
+ }
+ */
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index fe9fd0e8c4..1c382de228 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -229,6 +229,7 @@ private slots:
void qtbug_22679();
void qtbug_22843_data();
void qtbug_22843();
+ void rewriteMultiLineStrings();
void revisionErrors();
void revision();
@@ -5235,6 +5236,16 @@ void tst_qdeclarativeecmascript::qtbug_21864()
delete o;
}
+void tst_qdeclarativeecmascript::rewriteMultiLineStrings()
+{
+ // QTBUG-23387
+ QDeclarativeComponent component(&engine, testFileUrl("rewriteMultiLineStrings.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QTRY_COMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
void tst_qdeclarativeecmascript::qobjectConnectionListExceptionHandling()
{
// QTBUG-23375