diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-06-12 15:24:25 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-06-17 13:04:42 +0200 |
commit | 15777b94ee96035be79b363f3b1e54f02b5d2cd5 (patch) | |
tree | fb548bf756479b5a463c80fba7c5fa92cded2244 /tests/auto/qml/qmlformat/data | |
parent | 237a0e86c700116bfa55a1e1ee6fdabcc1ca5c9c (diff) |
qmlformat: Fix trailing newline in if blocks
Fixes: QTBUG-85003
Change-Id: Ie68c838c9bc1d52181a741871279bee5a8020855
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlformat/data')
5 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/qml/qmlformat/data/Example1.formatted.nosort.qml b/tests/auto/qml/qmlformat/data/Example1.formatted.nosort.qml index 34d58cf571..fdc0b1f68c 100644 --- a/tests/auto/qml/qmlformat/data/Example1.formatted.nosort.qml +++ b/tests/auto/qml/qmlformat/data/Example1.formatted.nosort.qml @@ -97,7 +97,6 @@ Item { console.log("other thing"); else console.log("false"); - if (x == 50) { console.log("true"); } else if (x == 50) { diff --git a/tests/auto/qml/qmlformat/data/Example1.formatted.qml b/tests/auto/qml/qmlformat/data/Example1.formatted.qml index b06734eb0b..5f12517781 100644 --- a/tests/auto/qml/qmlformat/data/Example1.formatted.qml +++ b/tests/auto/qml/qmlformat/data/Example1.formatted.qml @@ -97,7 +97,6 @@ Item { console.log("other thing"); else console.log("false"); - if (x == 50) { console.log("true"); } else if (x == 50) { diff --git a/tests/auto/qml/qmlformat/data/IfBlocks.formatted.qml b/tests/auto/qml/qmlformat/data/IfBlocks.formatted.qml index b8e77ec23a..b26361d5bf 100644 --- a/tests/auto/qml/qmlformat/data/IfBlocks.formatted.qml +++ b/tests/auto/qml/qmlformat/data/IfBlocks.formatted.qml @@ -24,7 +24,6 @@ Item { console.log("bar"); else console.log("baz"); - //// The following if blocks should HAVE braces // Single branch, braces if (true) { diff --git a/tests/auto/qml/qmlformat/data/QtBug85003.formatted.qml b/tests/auto/qml/qmlformat/data/QtBug85003.formatted.qml new file mode 100644 index 0000000000..ee42b39571 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/QtBug85003.formatted.qml @@ -0,0 +1,8 @@ +Item { + Component.onCompleted: { + if (3 < 2) + console.log("Foo"); + else + console.log("Bar"); + } +} diff --git a/tests/auto/qml/qmlformat/data/QtBug85003.qml b/tests/auto/qml/qmlformat/data/QtBug85003.qml new file mode 100644 index 0000000000..5d039cb9ca --- /dev/null +++ b/tests/auto/qml/qmlformat/data/QtBug85003.qml @@ -0,0 +1,6 @@ +Item { + Component.onCompleted: + { + if (3 < 2) console.log("Foo"); else { console.log("Bar"); } + } +} |