aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-10-07 11:23:33 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2020-10-07 13:08:19 +0200
commit26fa3d2cef8ec55dfb276e999d41e01e9a846093 (patch)
tree25156d4c3cccc770399fb2dddea82ff376b788d3 /tests
parent6857ad3e686a5e2b45d28a7f47dca3210608da50 (diff)
qmlformat: Make empty objects one liners
Fixes: QTBUG-87181 Change-Id: Ic8b7f69b4f9faf907ec75f27b689ba3686eb013f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmlformat/data/emptyObject.formatted.qml5
-rw-r--r--tests/auto/qml/qmlformat/data/emptyObject.qml3
-rw-r--r--tests/auto/qml/qmlformat/tst_qmlformat.cpp2
3 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/emptyObject.formatted.qml b/tests/auto/qml/qmlformat/data/emptyObject.formatted.qml
new file mode 100644
index 0000000000..a3c345db24
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/emptyObject.formatted.qml
@@ -0,0 +1,5 @@
+Item {
+ binding: {
+ var emptyObject = {};
+ }
+}
diff --git a/tests/auto/qml/qmlformat/data/emptyObject.qml b/tests/auto/qml/qmlformat/data/emptyObject.qml
new file mode 100644
index 0000000000..6855003fcd
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/emptyObject.qml
@@ -0,0 +1,3 @@
+Item {
+ binding: { var emptyObject = {}; }
+}
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
index 6f2410854a..45a51dec21 100644
--- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp
+++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
@@ -235,6 +235,8 @@ void TestQmlformat::testFormat_data()
<< "forOf.formatted.qml" << false << true;
QTest::newRow("property names") << "propertyNames.qml"
<< "propertyNames.formatted.qml" << false << true;
+ QTest::newRow("empty object") << "emptyObject.qml"
+ << "emptyObject.formatted.qml" << false << true;
}
void TestQmlformat::testFormat()