aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlformat/data/nestedIf.formatted.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlformat/data/nestedIf.formatted.qml')
-rw-r--r--tests/auto/qml/qmlformat/data/nestedIf.formatted.qml29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/nestedIf.formatted.qml b/tests/auto/qml/qmlformat/data/nestedIf.formatted.qml
new file mode 100644
index 0000000000..6c17f18a9c
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/nestedIf.formatted.qml
@@ -0,0 +1,29 @@
+Item {
+ Component.onCompleted: {
+ // Make sure that nested if statements get properly braced
+ if (a) {
+ if (b)
+ foo();
+ else
+ bar();
+ } else if (x == 3) {
+ stuff();
+ } else {
+ foo_bar();
+ }
+ // Same for "for"
+ if (a) {
+ for (x in y) {
+ bar();
+ y();
+ }
+ }
+ // ...and while
+ if (b) {
+ while (y in x) {
+ foo();
+ x();
+ }
+ }
+ }
+}