Skip to content
Snippets Groups Projects
Commit 330cea98 authored by jugglinmike's avatar jugglinmike Committed by Leo Balter
Browse files

[runner] Add support for "folding" block delimiter (#654)

parent 1e75730d
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ def load(str): ...@@ -43,7 +43,7 @@ def load(str):
return dict return dict
def myReadValue(lines, value): def myReadValue(lines, value):
if value == ">": if value == ">" or value == "|":
(lines, value) = myMultiline(lines, value) (lines, value) = myMultiline(lines, value)
value = value + "\n" value = value + "\n"
return (lines, value) return (lines, value)
......
...@@ -81,6 +81,11 @@ class TestMonkeyYAMLParsing(unittest.TestCase): ...@@ -81,6 +81,11 @@ class TestMonkeyYAMLParsing(unittest.TestCase):
self.assertEqual(lines, [" other: 42"]) self.assertEqual(lines, [" other: 42"])
self.assertEqual(value, "foo bar") self.assertEqual(value, "foo bar")
def test_Multiline_5(self):
lines = ["info: |", " attr: this is a string (not nested yaml)", ""]
y = "\n".join(lines)
self.assertEqual(monkeyYaml.load(y), yaml.load(y))
def test_myLeading(self): def test_myLeading(self):
self.assertEqual(2, monkeyYaml.myLeadingSpaces(" foo")) self.assertEqual(2, monkeyYaml.myLeadingSpaces(" foo"))
self.assertEqual(2, monkeyYaml.myLeadingSpaces(" ")) self.assertEqual(2, monkeyYaml.myLeadingSpaces(" "))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment