summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2018-01-02 00:44:15 +0000
committerrsiddharth <s@ricketyspace.net>2018-01-02 00:44:15 +0000
commitcad2e7b18e510a89e159148f1141691fd1fc6715 (patch)
treeb0775d38b5f476105b7167826a432a93b33f4164 /tests
parentd78ac3764a90fc959862777f37fc9f175e5272e1 (diff)
md_tw.py: Add TWBlockLexer.parse_hrule.
* md_tw.py (TWBlockLexer.parse_hrule): New method * tests/test_md_tw.py (TestTWBlockLexer.test_parse_hrule): New test. * tests/data/blexer-hrules.md: New file.
Diffstat (limited to 'tests')
-rw-r--r--tests/data/blexer-hrules.md19
-rw-r--r--tests/test_md_tw.py13
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/data/blexer-hrules.md b/tests/data/blexer-hrules.md
new file mode 100644
index 0000000..2b2bc24
--- /dev/null
+++ b/tests/data/blexer-hrules.md
@@ -0,0 +1,19 @@
+* * *
+
+Dresden Dolls
+
+***
+
+God Damn The Sun
+
+*****
+
+Backstabber
+
+- - -
+
+Sorry Bunch
+
+---------------------------------------
+
+Gravity
diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py
index a71c191..da7981c 100644
--- a/tests/test_md_tw.py
+++ b/tests/test_md_tw.py
@@ -90,6 +90,19 @@ class TestTWBlockLexer(object):
self._validate(tokens, 'heading', expected_lhs)
+ def test_parse_hrule(self):
+ tokens = self._parse('blexer-hrules.md')
+
+ expected_hrs = [
+ '* * *\n\n',
+ '***\n\n',
+ '*****\n\n',
+ '- - -\n\n',
+ '---------------------------------------\n\n'
+ ]
+
+ self._validate(tokens, 'hrule', expected_hrs)
+
def teardown(self):
pass