From db96eeb7852f644e4269aa7d3b4372b58c7e4fb4 Mon Sep 17 00:00:00 2001 From: Bruno Miguens Date: Mon, 8 Feb 2021 16:56:41 +0000 Subject: [PATCH] Add tests for basic and thead/tbody tables --- tests/test_conversions.py | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/test_conversions.py b/tests/test_conversions.py index edaefbc..f274324 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -22,6 +22,52 @@ nested_uls = re.sub(r'\s+', '', """ """) +table = re.sub(r'\s+', '', """ + + + + + + + + + + + + + + + + +
FirstnameLastnameAge
JillSmith50
EveJackson94
+""") + + +table_head_body = re.sub(r'\s+', '', """ + + + + + + + + + + + + + + + + + + + + +
FirstnameLastnameAge
JillSmith50
EveJackson94
+""") + + def test_chomp(): assert md(' ') == ' ' assert md(' ') == ' ' @@ -31,6 +77,11 @@ def test_chomp(): assert md(' s ') == ' **s** ' assert md(' s ') == ' **s** ' assert md(' s ') == ' **s** ' + assert md('bold with br
italic') == '**bold with br***italic*' + + +def test_chomp_ext(): + assert md('bold with br
italic') == '**bold with br***italic*' def test_a(): @@ -216,3 +267,8 @@ def test_img(): def test_div(): assert md('Hello World') == 'Hello World' + + +def test_table(): + assert md(table) == 'Firstname | Lastname | Age\n--- | --- | ---\nJill | Smith | 50\nEve | Jackson | 94' + assert md(table_head_body) == 'Firstname | Lastname | Age\n--- | --- | ---\nJill | Smith | 50\nEve | Jackson | 94'