1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

tests: use double quotes instead of simple quotes in ruby script generator

This allows to use escaped chars in strings.
This commit is contained in:
Sébastien Helleu
2022-08-02 20:54:35 +02:00
parent 05abbac297
commit 2ed281af02
+7
View File
@@ -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(