diff options
Diffstat (limited to 'tests/test_doctests.txt')
-rw-r--r-- | tests/test_doctests.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_doctests.txt b/tests/test_doctests.txt new file mode 100644 index 0000000..692690b --- /dev/null +++ b/tests/test_doctests.txt @@ -0,0 +1,22 @@ +Document #1: + +>>> from wikimini.document import * +>>> blocks = [] +>>> insert_into(blocks, Plain("Paragraph ")) +>>> insert_into(blocks, Plain("1\n\nParagraph 2")) +>>> # blocks == [Paragraph(...), Paragraph(...)] +>>> assert len(blocks) == 2 + +Document #2: + +>>> from wikimini.document import * +>>> verbatim = Verbatim("") +>>> verbatim.append(InlineLink("http://localhost", Plain("Visit here!"))) +>>> assert verbatim.text == "Visit here!" + +Format #1: + +>>> from wikimini.document import Heading +>>> from wikimini.formats import gemtext, as_string +>>> as_string(gemtext.Gemtext(None), Heading(1, "Coffee")) +'# Coffee\n' |