summaryrefslogtreecommitdiff
path: root/test cases/format/5 transform
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2025-09-23 11:20:49 -0400
committerDylan Baker <dylan@pnwbakers.com>2025-09-24 08:13:04 -0700
commit97e9e2fb66895d2fc1b4a714a428468aeebf9648 (patch)
tree6189ef4480fe5703e5fabc6445e937f9031c141f /test cases/format/5 transform
parentb91fede6d263286fa1e20d424f92d1e10668a8ed (diff)
downloadmeson-97e9e2fb66895d2fc1b4a714a428468aeebf9648.tar.gz
format: Fix indentation with parentheses
- Split long expressions in () according to max line length - Partly revert d028502 . Fixes #14935. - Fixes #15032.
Diffstat (limited to 'test cases/format/5 transform')
-rw-r--r--test cases/format/5 transform/default.expected.meson15
-rw-r--r--test cases/format/5 transform/muon.expected.meson15
-rw-r--r--test cases/format/5 transform/options.expected.meson28
-rw-r--r--test cases/format/5 transform/source.meson27
4 files changed, 57 insertions, 28 deletions
diff --git a/test cases/format/5 transform/default.expected.meson b/test cases/format/5 transform/default.expected.meson
index 4a9851ac9..702ae5643 100644
--- a/test cases/format/5 transform/default.expected.meson
+++ b/test cases/format/5 transform/default.expected.meson
@@ -8,7 +8,7 @@ f = files(options_ini, 'expected.meson', 'source.meson')
# This array should fit on one line
a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
-# This array is too long and should be splitted
+# This array is too long and should be split
a2 = [
2,
3,
@@ -81,4 +81,17 @@ arguments = [
'--x',
]
+# issue #15032
+if true
+ if true
+ if (
+ true
+ and true
+ and false
+ )
+ message('Hello, world!')
+ endif
+ endif
+endif
+
# no final endline
diff --git a/test cases/format/5 transform/muon.expected.meson b/test cases/format/5 transform/muon.expected.meson
index 3b6127030..f01849734 100644
--- a/test cases/format/5 transform/muon.expected.meson
+++ b/test cases/format/5 transform/muon.expected.meson
@@ -8,7 +8,7 @@ f = files('expected.meson', 'source.meson', options_ini)
# This array should fit on one line
a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
-# This array is too long and should be splitted
+# This array is too long and should be split
a2 = [
2,
3,
@@ -81,4 +81,17 @@ arguments = [
'--x',
]
+# issue #15032
+if true
+ if true
+ if (
+ true
+ and true
+ and false
+ )
+ message('Hello, world!')
+ endif
+ endif
+endif
+
# no final endline
diff --git a/test cases/format/5 transform/options.expected.meson b/test cases/format/5 transform/options.expected.meson
index 84917c19d..7136506c0 100644
--- a/test cases/format/5 transform/options.expected.meson
+++ b/test cases/format/5 transform/options.expected.meson
@@ -8,25 +8,14 @@ f = files(options_ini, 'expected.meson', 'source.meson')
# This array should fit on one line
a1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 ]
-# This array is too long and should be splitted
+# This array is too long and should be split
a2 = [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ]
# space array
a3 = [ 1, 2, 3 ]
# multi line expression
-is_foo = (
- true
- and false
- and true
- and false
- and true
- and false
- and true
- and false
- and true
- and false
-)
+is_foo = (true and false and true and false and true and false and true and false and true and false)
# no single comma function
fct = files(
@@ -60,4 +49,17 @@ arguments = [
'--x',
]
+# issue #15032
+if true
+ if true
+ if (
+ true
+ and true
+ and false
+ )
+ message('Hello, world!')
+ endif
+ endif
+endif
+
# no final endline \ No newline at end of file
diff --git a/test cases/format/5 transform/source.meson b/test cases/format/5 transform/source.meson
index a3b326b12..554b9e6a7 100644
--- a/test cases/format/5 transform/source.meson
+++ b/test cases/format/5 transform/source.meson
@@ -12,25 +12,14 @@ f = files(
# This array should fit on one line
a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
-# This array is too long and should be splitted
+# This array is too long and should be split
a2 = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
# space array
a3 = [ 1, 2, 3 ]
# multi line expression
-is_foo = (
- true
- and false
- and true
- and false
- and true
- and false
- and true
- and false
- and true
- and false
-)
+is_foo = (true and false and true and false and true and false and true and false and true and false)
# no single comma function
fct = files(
@@ -49,4 +38,16 @@ f'This is not a fstring'
arguments = ['a', '--opt_a', 'opt_a_value', 'b', 'c', '--opt_d', '--opt_e', 'opt_e_value',
'--opt_f', '--opt_g', 'opt_g_value', 'other_value', 'again', '--x']
+# issue #15032
+if true
+ if true
+ if (true and
+ true and
+ false
+ )
+ message('Hello, world!')
+ endif
+ endif
+endif
+
# no final endline \ No newline at end of file