aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qmlformat/data/multilineComment.formatted.qml12
-rw-r--r--tests/auto/qml/qmlformat/data/multilineComment.qml10
-rw-r--r--tests/auto/qml/qmlformat/tst_qmlformat.cpp7
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/multilineComment.formatted.qml b/tests/auto/qml/qmlformat/data/multilineComment.formatted.qml
new file mode 100644
index 0000000000..830ff32095
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/multilineComment.formatted.qml
@@ -0,0 +1,12 @@
+Item {
+ Item {
+ }
+
+ // This is a multiline comment.
+ // it should stay attached to Commented instead of getting orphaned.
+ //
+ // This should also stick to Commented
+ Commented {
+ }
+
+}
diff --git a/tests/auto/qml/qmlformat/data/multilineComment.qml b/tests/auto/qml/qmlformat/data/multilineComment.qml
new file mode 100644
index 0000000000..27439c41fa
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/multilineComment.qml
@@ -0,0 +1,10 @@
+Item {
+ Item {}
+
+ /* This is a multiline comment.
+ it should stay attached to Commented instead of getting orphaned.
+ */
+ // This should also stick to Commented
+ Commented {}
+
+}
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
index a3f5cd1a2b..3b1f232139 100644
--- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp
+++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
@@ -49,6 +49,7 @@ private Q_SLOTS:
void testLineEndings();
void testFrontInline();
void testIfBlocks();
+ void testMultilineComments();
void testReadOnlyProps();
void testVerbatimStrings();
@@ -221,6 +222,12 @@ void TestQmlformat::testIfBlocks()
QCOMPARE(runQmlformat(testFile("IfBlocks.qml"), false, true), readTestFile("IfBlocks.formatted.qml"));
}
+void TestQmlformat::testMultilineComments()
+{
+ QCOMPARE(runQmlformat(testFile("multilineComment.qml"), false, true), readTestFile("multilineComment.formatted.qml"));
+}
+
+
void TestQmlformat::testReadOnlyProps()
{
QCOMPARE(runQmlformat(testFile("readOnlyProps.qml"), false, true), readTestFile("readOnlyProps.formatted.qml"));