X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/blobdiff_plain/0ac6446efaa9741306faa02a4a4ddd7b872ec10c..65fd4f767aa95e8da1ff83c16f82223740611fd6:/tests/test_mwmarkup.py
diff --git a/tests/test_mwmarkup.py b/tests/test_mwmarkup.py
index df3eb01..3d8c2cb 100644
--- a/tests/test_mwmarkup.py
+++ b/tests/test_mwmarkup.py
@@ -82,6 +82,19 @@ def test_create_template():
assert wikitext_generated == wikitext
+def test_find_tag():
+ wikitext = u'This is my first tag and my second tag.'
+ start, content, endtag, end = wrpylib.mwmarkup.find_tag(wikitext, u'tags')
+ assert (start, content, endtag, end) == (None, None, None, None)
+ start, content, endtag, end = wrpylib.mwmarkup.find_tag(wikitext, u'tag')
+ assert (start, content, endtag, end) == (8, 13, 25, 31)
+ start, content, endtag, end = wrpylib.mwmarkup.find_tag(wikitext, u'tag', end)
+ assert (start, content, endtag, end) == (36, 41, 54, 60)
+ wikitext = u'This is .'
+ start, content, endtag, end = wrpylib.mwmarkup.find_tag(wikitext, u'tag')
+ assert (start, content, endtag, end) == (8, None, None, 27)
+
+
def test_parse_googlemap():
wikitext = u'''