summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2016-03-10 15:17:54 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2016-03-10 15:17:54 -0500
commit69b3cf9581aec0b13aa800a639016fc88fdc80de (patch)
tree60eb4753e78fead13f62f18439620fd6c5204d87
parent7c528cd8b300e48bc8fad430865c6955038b6333 (diff)
downloadpython-markdown-utest.tar.gz
Added more hr tests.utest
-rw-r--r--tests/syntax_unittests/blocks/test_hr.py84
1 files changed, 58 insertions, 26 deletions
diff --git a/tests/syntax_unittests/blocks/test_hr.py b/tests/syntax_unittests/blocks/test_hr.py
index e7cc4a8..6e061c7 100644
--- a/tests/syntax_unittests/blocks/test_hr.py
+++ b/tests/syntax_unittests/blocks/test_hr.py
@@ -3,84 +3,84 @@ from markdown.test_tools import TestCase
class TestHorizontalRules(TestCase):
- def test_hr_asterisk(self):
+ def test_hr_asterisks(self):
self.assertMarkdownRenders(
'***',
'<hr />'
)
- def test_hr_asterisk_spaces(self):
+ def test_hr_asterisks_spaces(self):
self.assertMarkdownRenders(
'* * *',
'<hr />'
)
- def test_hr_asterisk_long(self):
+ def test_hr_asterisks_long(self):
self.assertMarkdownRenders(
'*******',
'<hr />'
)
- def test_hr_asterisk_spaces_long(self):
+ def test_hr_asterisks_spaces_long(self):
self.assertMarkdownRenders(
'* * * * * * *',
'<hr />'
)
- def test_hr_asterisk_1_indent(self):
+ def test_hr_asterisks_1_indent(self):
self.assertMarkdownRenders(
' ***',
'<hr />'
)
- def test_hr_asterisk_spaces_1_indent(self):
+ def test_hr_asterisks_spaces_1_indent(self):
self.assertMarkdownRenders(
' * * *',
'<hr />'
)
-
- def test_hr_asterisk_2_indent(self):
+
+ def test_hr_asterisks_2_indent(self):
self.assertMarkdownRenders(
' ***',
'<hr />'
)
- def test_hr_asterisk_spaces_2_indent(self):
+ def test_hr_asterisks_spaces_2_indent(self):
self.assertMarkdownRenders(
' * * *',
'<hr />'
)
-
- def test_hr_asterisk_3_indent(self):
+
+ def test_hr_asterisks_3_indent(self):
self.assertMarkdownRenders(
' ***',
'<hr />'
)
- def test_hr_asterisk_spaces_3_indent(self):
+ def test_hr_asterisks_spaces_3_indent(self):
self.assertMarkdownRenders(
' * * *',
'<hr />'
)
-
- def test_hr_asterisk_trailing_space(self):
+
+ def test_hr_asterisks_trailing_space(self):
self.assertMarkdownRenders(
'*** ',
'<hr />'
)
- def test_hr_asterisk_spaces_trailing_space(self):
+ def test_hr_asterisks_spaces_trailing_space(self):
self.assertMarkdownRenders(
'* * * ',
@@ -100,7 +100,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_hyphens_long(self):
self.assertMarkdownRenders(
'-------',
@@ -114,7 +114,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_hyphens_1_indent(self):
self.assertMarkdownRenders(
' ---',
@@ -128,7 +128,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_hyphens_2_indent(self):
self.assertMarkdownRenders(
' ---',
@@ -142,7 +142,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_hyphens_3_indent(self):
self.assertMarkdownRenders(
' ---',
@@ -156,7 +156,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_hyphens_trailing_space(self):
self.assertMarkdownRenders(
'--- ',
@@ -184,7 +184,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_underscores_long(self):
self.assertMarkdownRenders(
'_______',
@@ -212,7 +212,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_underscores_2_indent(self):
self.assertMarkdownRenders(
' ___',
@@ -226,7 +226,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_underscores_3_indent(self):
self.assertMarkdownRenders(
' ___',
@@ -240,7 +240,7 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
-
+
def test_hr_underscores_trailing_space(self):
self.assertMarkdownRenders(
'___ ',
@@ -255,14 +255,46 @@ class TestHorizontalRules(TestCase):
'<hr />'
)
- def test_not_hr_2_asterisk(self):
+ def test_hr_before_paragraph(self):
+ self.assertMarkdownRenders(
+ self.dedent(
+ """
+ ***
+ An HR followed by a paragraph with no blank line.
+ """
+ ),
+ self.dedent(
+ """
+ <hr />
+ <p>An HR followed by a paragraph with no blank line.</p>
+ """
+ )
+ )
+
+ def test_hr_after_paragraph(self):
+ self.assertMarkdownRenders(
+ self.dedent(
+ """
+ A paragraph followed by an HR with no blank line.
+ ***
+ """
+ ),
+ self.dedent(
+ """
+ <p>A paragraph followed by an HR with no blank line.</p>
+ <hr />
+ """
+ )
+ )
+
+ def test_not_hr_2_asterisks(self):
self.assertMarkdownRenders(
'**',
'<p>**</p>'
)
- def test_not_hr_2_asterisk_spaces(self):
+ def test_not_hr_2_asterisks_spaces(self):
self.assertMarkdownRenders(
'* *',