@@ -303,6 +303,20 @@ class TestBuilder(TreeEqualityTestCase): | |||||
Text(" "), Wikilink(wraptext("q")), Text(" "), | Text(" "), Wikilink(wraptext("q")), Text(" "), | ||||
Template(wraptext("r"))]), True, " \n ", " ", | 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: | for test, valid in tests: | ||||
self.assertWikicodeEqual(valid, self.builder.build(test)) | self.assertWikicodeEqual(valid, self.builder.build(test)) | ||||
@@ -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()] |