diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-07 12:46:24 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-08 09:57:47 +0200 |
commit | 61417ad3525d33c41e7d8423103e876a922d5f8b (patch) | |
tree | 76568d9cfccbe25059e3c0f0e23a3894a5b9ffe6 /tests/auto/qml/qmlformat | |
parent | b0652fe3d7a77d38ac2bd427fba6e542d363eec6 (diff) |
qmlformat: Make arrow functions one liners
Fixes: QTBUG-87179
Change-Id: Ieb7dffab59923bcb2ce8745c499eff7de44134b1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlformat')
-rw-r--r-- | tests/auto/qml/qmlformat/data/arrowFunctions.formatted.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/data/arrowFunctions.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/tst_qmlformat.cpp | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/arrowFunctions.formatted.qml b/tests/auto/qml/qmlformat/data/arrowFunctions.formatted.qml new file mode 100644 index 0000000000..e4bc1f6747 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/arrowFunctions.formatted.qml @@ -0,0 +1,5 @@ +Item { + arrow1: (x) => x + arrow2: (x) => x + x + arrow3: () => x > 3 ? x * x : x +} diff --git a/tests/auto/qml/qmlformat/data/arrowFunctions.qml b/tests/auto/qml/qmlformat/data/arrowFunctions.qml new file mode 100644 index 0000000000..e4bc1f6747 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/arrowFunctions.qml @@ -0,0 +1,5 @@ +Item { + arrow1: (x) => x + arrow2: (x) => x + x + arrow3: () => x > 3 ? x * x : x +} diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index 45a51dec21..dfe41a77d8 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -237,6 +237,8 @@ void TestQmlformat::testFormat_data() << "propertyNames.formatted.qml" << false << true; QTest::newRow("empty object") << "emptyObject.qml" << "emptyObject.formatted.qml" << false << true; + QTest::newRow("arrow functions") << "arrowFunctions.qml" + << "arrowFunctions.formatted.qml" << false << true; } void TestQmlformat::testFormat() |