summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-08-02 20:54:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-08-02 20:54:35 +0200
commit2ed281af02d9d251a6d20bac9ccbd916275cc966 (patch)
treeb648376d4fba34856a6251dbcf002e479c0e9ce9 /tests/scripts
parent05abbac297d3fe97d159b8468fb463d6e7a28c2b (diff)
downloadweechat-2ed281af02d9d251a6d20bac9ccbd916275cc966.zip
tests: use double quotes instead of simple quotes in ruby script generator
This allows to use escaped chars in strings.
Diffstat (limited to 'tests/scripts')
-rwxr-xr-xtests/scripts/python/unparse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py
index f3c1066b7..e0991292b 100755
--- a/tests/scripts/python/unparse.py
+++ b/tests/scripts/python/unparse.py
@@ -523,6 +523,13 @@ class UnparseRuby(UnparsePython):
node.attr,
)
+ def _ast_constant(self, node):
+ """Add an AST Constant in output."""
+ if isinstance(node.value, str):
+ self.add('"%s"' % node.s.replace('#{', '\\#{'))
+ else:
+ self.add(repr(node.s))
+
def _ast_dict(self, node):
"""Add an AST Dict in output."""
self.add(