diff --git a/tests/test_builder.py b/tests/test_builder.py index c987820..29ae65a 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -303,6 +303,20 @@ class TestBuilder(TreeEqualityTestCase): Text(" "), Wikilink(wraptext("q")), Text(" "), Template(wraptext("r"))]), True, " \n ", " ", " ")])])), + + # "''italic text''" + ([tokens.TagOpenOpen(wiki_markup="''"), tokens.Text(text="i"), + tokens.TagCloseOpen(), tokens.Text(text="italic text"), + tokens.TagOpenClose(), tokens.Text(text="i"), + tokens.TagCloseClose()], + wrap([Tag(wraptext("i"), wraptext("italic text"), + wiki_markup="''")])), + + # * bullet + ([tokens.TagOpenOpen(wiki_markup="*"), tokens.Text(text="li"), + tokens.TagCloseSelfclose(), tokens.Text(text=" bullet")], + wrap([Tag(wraptext("li"), wiki_markup="*", self_closing=True), + Text(" bullet")])), ] for test, valid in tests: self.assertWikicodeEqual(valid, self.builder.build(test)) diff --git a/tests/tokenizer/tags_wikimarkup.mwtest b/tests/tokenizer/tags_wikimarkup.mwtest new file mode 100644 index 0000000..7dc211e --- /dev/null +++ b/tests/tokenizer/tags_wikimarkup.mwtest @@ -0,0 +1,46 @@ +name: basic_italics +label: basic italic text +input: "''text''" +output: [TagOpenOpen(wiki_markup="''"), Text(text="i"), TagCloseOpen(), Text(text="text"), TagOpenClose(), Text(text="i"), TagCloseClose()] + +--- + +name: basic_bold +label: basic bold text +input: "'''text'''" +output: [TagOpenOpen(wiki_markup="'''"), Text(text="b"), TagCloseOpen(), Text(text="text"), TagOpenClose(), Text(text="b"), TagCloseClose()] + +--- + +name: basic_ul +label: basic unordered list +input: "*text" +output: [TagOpenOpen(wiki_markup="*"), Text(text="li"), TagCloseSelfclose(), Text(text="text")] + +--- + +name: basic_ol +label: basic ordered list +input: "#text" +output: [TagOpenOpen(wiki_markup="#"), Text(text="li"), TagCloseSelfclose(), Text(text="text")] + +--- + +name: basic_dt +label: basic description term +input: ";text" +output: [TagOpenOpen(wiki_markup=";"), Text(text="dt"), TagCloseSelfclose(), Text(text="text")] + +--- + +name: basic_dd +label: basic description item +input: ":text" +output: [TagOpenOpen(wiki_markup=":"), Text(text="dd"), TagCloseSelfclose(), Text(text="text")] + +--- + +name: basic_hr +label: basic horizontal rule +input: "----" +output: [TagOpenOpen(wiki_markup="----"), Text(text="hr"), TagCloseSelfclose()]