From 8c27daf29ef5487c01806cfdea427e9444cbae88 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Sat, 2 Nov 2024 11:13:56 +0000 Subject: [PATCH] Add parser tests Change-Id: I13e373a38b6486f938ca7d86620e3672de4408bb --- tests/parser/parserTests.txt | 137 +++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 tests/parser/parserTests.txt diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt new file mode 100644 index 00000000..dfc25408 --- /dev/null +++ b/tests/parser/parserTests.txt @@ -0,0 +1,137 @@ +!! options +version=2 +parsoid-compatible=wt2html +!! end + +!! test +Self-closing tag: +!! wikitext + +!! html/php +!! html/parsoid +

+!! end + +!! test +Empty tag: +!! wikitext + +!! html/php +!! html/parsoid +

+!! end + +!! test +Empty function: {{#categorytree:}} +!! wikitext +{{#categorytree:}} +!! html/php +!! html/parsoid +

+!! end + +!! test +Tag with Unknown category: Unknown category +!! wikitext +Unknown category +!! html/php +
Category Unknown category not found
+!! html/parsoid +
Category Unknown category not found
+!! end + +!! test +Function with Unknown category: {{#categorytree:Unknown category}} +!! wikitext +{{#categorytree:Unknown category}} +!! html/php +
Category Unknown category not found
+!! html/parsoid +
Category Unknown category not found
+!! end + +!! test +Tag with Unknown category and parameters: Unknown category +!! wikitext +Unknown category +!! html/php +
Category Unknown category not found
+!! html/parsoid +
Category Unknown category not found
+!! end + +!! article +Category:CategoryTree test category +!! text +!! endarticle + +!! test +Tag with Category:CategoryTree test category +!! wikitext +CategoryTree test category +!! html/php + +!! html/parsoid +
+
+ +
no subcategories
+
+
+!! end + +!! article +Category:CategoryTree test category 2 +!! text +!! endarticle + +!! test +Tag with Category:CategoryTree test category 2 and hideroot=1 +!! wikitext +CategoryTree test category 2 +!! html/php +
+!! html/parsoid +
+!! end + +!! article +Category:CategoryTree root +!! text +!! endarticle + +!! article +Category:CategoryTree 1 +!! text +[[Category:CategoryTree root]] +!! endarticle + +!! article +Category:CategoryTree 2 +!! text +[[Category:CategoryTree root]] +!! endarticle + +!! test +Tag with CategoryTree root and two subcategories +!! wikitext +CategoryTree root +!! html/php + +!! html/parsoid +
+ +
+!! end