diff --git a/tests/test_generate.py b/tests/test_generate.py
index a49c6ce..c69ca57 100644
--- a/tests/test_generate.py
+++ b/tests/test_generate.py
@@ -1,3 +1,4 @@
+import re
from gmirator.generate import (
process_file,
process_list,
@@ -11,13 +12,26 @@ def test_process_file():
pass
def test_process_list():
+ test_str = "this is a line outside a list"
+ assert process_list(test_str, True) == ("\n\n", False)
+ assert process_list(test_str, False) == (test_str, False)
+ test_str = "* this is a list item"
+ assert process_list(test_str, True) == ("
this is a list item", True)
+ assert process_list(test_str, False) == ("\n- this is a list item
", True)
pass
def test_process_inline():
assert process_inline("*Hello* ~~world~~!") == "Hello world!"
-def test_repl_url():
- pass
+def test_repl_url_external_gmi_url():
+ external_url = "=> gemini://domain/gempage.gmi\n"
+ new_url = re.sub(r'^=> (?P[^ ]*) ?(?P.*)\n', repl_url, external_url)
+ assert new_url == '=> gemini://domain/gempage.gmi
\n'
+
+def test_repl_url_internal_gmi_url():
+ external_url = "=> /gempage.gmi title\n"
+ new_url = re.sub(r'^=> (?P[^ ]*) ?(?P.*)\n', repl_url, external_url)
+ assert new_url == '=> title
\n'
def test_repl_heading():
pass