Compare commits
1 Commits
b70baa0eb8
...
9b319a90dc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9b319a90dc |
@ -884,7 +884,7 @@ class Headline:
|
|||||||
|
|
||||||
names_by_line = {}
|
names_by_line = {}
|
||||||
for kw in self.keywords:
|
for kw in self.keywords:
|
||||||
if kw.key == 'NAME':
|
if kw.key == "NAME":
|
||||||
names_by_line[kw.linenum] = kw.value
|
names_by_line[kw.linenum] = kw.value
|
||||||
|
|
||||||
name = None
|
name = None
|
||||||
|
@ -480,10 +480,7 @@ class TestSerde(unittest.TestCase):
|
|||||||
|
|
||||||
snippets = list(doc.get_code_snippets())
|
snippets = list(doc.get_code_snippets())
|
||||||
self.assertEqual(len(snippets), 3)
|
self.assertEqual(len(snippets), 3)
|
||||||
self.assertEqual(
|
self.assertEqual(snippets[0].name, "first-code-name")
|
||||||
snippets[0].name,
|
|
||||||
'first-code-name'
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
snippets[0].content,
|
snippets[0].content,
|
||||||
'echo "This is a test"\n'
|
'echo "This is a test"\n'
|
||||||
@ -498,10 +495,7 @@ class TestSerde(unittest.TestCase):
|
|||||||
"This is a test\n" + "with two lines",
|
"This is a test\n" + "with two lines",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(snippets[1].name, None)
|
||||||
snippets[1].name,
|
|
||||||
None
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
snippets[1].content,
|
snippets[1].content,
|
||||||
'echo "This is another test"\n'
|
'echo "This is another test"\n'
|
||||||
@ -512,10 +506,7 @@ class TestSerde(unittest.TestCase):
|
|||||||
snippets[1].result, "This is another test\n" + "with two lines too"
|
snippets[1].result, "This is another test\n" + "with two lines too"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(snippets[2].name, None)
|
||||||
snippets[2].name,
|
|
||||||
None
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
snippets[2].content,
|
snippets[2].content,
|
||||||
"/* This code has to be escaped to\n"
|
"/* This code has to be escaped to\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user