diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmlformat/data/largeBindings.formatted.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/data/largeBindings.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/tst_qmlformat.cpp | 7 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml b/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml new file mode 100644 index 0000000000..1118c661ed --- /dev/null +++ b/tests/auto/qml/qmlformat/data/largeBindings.formatted.qml @@ -0,0 +1,7 @@ +QtObject { + smallButNeedsBraces: { + if (foo) { + bar(); + } + } +} diff --git a/tests/auto/qml/qmlformat/data/largeBindings.qml b/tests/auto/qml/qmlformat/data/largeBindings.qml new file mode 100644 index 0000000000..7bbc365c13 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/largeBindings.qml @@ -0,0 +1,4 @@ +QtObject +{ + smallButNeedsBraces: if (foo) { bar(); } +} diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index ba34f0f923..0e0bc53857 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -52,6 +52,7 @@ private Q_SLOTS: void testReadOnlyProps(); void testVerbatimStrings(); + void testLargeBindings(); #if !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled void testExample(); @@ -224,6 +225,12 @@ void TestQmlformat::testVerbatimStrings() readTestFile("verbatimString.formatted.qml")); } +void TestQmlformat::testLargeBindings() +{ + QCOMPARE(runQmlformat(testFile("largeBindings.qml"), false, true), + readTestFile("largeBindings.formatted.qml")); +} + void TestQmlformat::testLineEndings() { // macos |