Read names for code blocks.
Some checks failed
Some checks failed
This commit is contained in:
parent
1dc6eb0b43
commit
b70baa0eb8
3 changed files with 25 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
:CREATED: [2020-01-01 Wed 01:01]
|
||||
:END:
|
||||
|
||||
#+NAME: first-code-name
|
||||
#+BEGIN_SRC shell :results verbatim
|
||||
echo "This is a test"
|
||||
echo "with two lines"
|
||||
|
|
|
@ -480,6 +480,10 @@ class TestSerde(unittest.TestCase):
|
|||
|
||||
snippets = list(doc.get_code_snippets())
|
||||
self.assertEqual(len(snippets), 3)
|
||||
self.assertEqual(
|
||||
snippets[0].name,
|
||||
'first-code-name'
|
||||
)
|
||||
self.assertEqual(
|
||||
snippets[0].content,
|
||||
'echo "This is a test"\n'
|
||||
|
@ -494,6 +498,10 @@ class TestSerde(unittest.TestCase):
|
|||
"This is a test\n" + "with two lines",
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
snippets[1].name,
|
||||
None
|
||||
)
|
||||
self.assertEqual(
|
||||
snippets[1].content,
|
||||
'echo "This is another test"\n'
|
||||
|
@ -504,6 +512,10 @@ class TestSerde(unittest.TestCase):
|
|||
snippets[1].result, "This is another test\n" + "with two lines too"
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
snippets[2].name,
|
||||
None
|
||||
)
|
||||
self.assertEqual(
|
||||
snippets[2].content,
|
||||
"/* This code has to be escaped to\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue