summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/mformat.py2
-rw-r--r--test cases/format/5 transform/default.expected.meson1
-rw-r--r--test cases/format/5 transform/muon.expected.meson1
-rw-r--r--test cases/format/5 transform/options.expected.meson1
-rw-r--r--test cases/format/5 transform/source.meson1
5 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py
index bab3e5a17..27f97b4fa 100644
--- a/mesonbuild/mformat.py
+++ b/mesonbuild/mformat.py
@@ -338,7 +338,7 @@ class TrimWhitespaces(FullAstVisitor):
self.enter_node(node)
if self.config.simplify_string_literals:
- if node.is_multiline and '\n' not in node.value:
+ if node.is_multiline and not any(x in node.value for x in ['\n', "'"]):
node.is_multiline = False
node.value = node.escape()
diff --git a/test cases/format/5 transform/default.expected.meson b/test cases/format/5 transform/default.expected.meson
index 4201053e1..18af2f8af 100644
--- a/test cases/format/5 transform/default.expected.meson
+++ b/test cases/format/5 transform/default.expected.meson
@@ -47,6 +47,7 @@ d = {'a': 1, 'b': 2, 'c': 3}
# string conversion
'This is not a multiline'
'This is not a fstring'
+'''This isn't convertible'''
# group arg value
arguments = [
diff --git a/test cases/format/5 transform/muon.expected.meson b/test cases/format/5 transform/muon.expected.meson
index 871ce27d7..0e6309c7f 100644
--- a/test cases/format/5 transform/muon.expected.meson
+++ b/test cases/format/5 transform/muon.expected.meson
@@ -47,6 +47,7 @@ d = {'a': 1, 'b': 2, 'c': 3}
# string conversion
'''This is not a multiline'''
f'This is not a fstring'
+'''This isn't convertible'''
# group arg value
arguments = [
diff --git a/test cases/format/5 transform/options.expected.meson b/test cases/format/5 transform/options.expected.meson
index f7f45658d..9ed6ac2be 100644
--- a/test cases/format/5 transform/options.expected.meson
+++ b/test cases/format/5 transform/options.expected.meson
@@ -29,6 +29,7 @@ d = {
# string conversion
'This is not a multiline'
'This is not a fstring'
+'''This isn't convertible'''
# group arg value
arguments = [
diff --git a/test cases/format/5 transform/source.meson b/test cases/format/5 transform/source.meson
index 7274d4802..448288405 100644
--- a/test cases/format/5 transform/source.meson
+++ b/test cases/format/5 transform/source.meson
@@ -29,6 +29,7 @@ d = {'a': 1, 'b': 2, 'c': 3}
# string conversion
'''This is not a multiline'''
f'This is not a fstring'
+'''This isn't convertible'''
# group arg value
arguments = ['a', '--opt_a', 'opt_a_value', 'b', 'c', '--opt_d', '--opt_e', 'opt_e_value',