Skip to content

Commit

Permalink
Better class-based tests structure for markdown. #1490
Browse files Browse the repository at this point in the history
  • Loading branch information
miteshashar committed Nov 3, 2022
1 parent b6c1cf1 commit 3ea2cfa
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 282 deletions.
1 change: 0 additions & 1 deletion tests/data/markdown/basic.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Basic markup
This is a sample paragraph that has **asterisk bold**, *asterisk emphasized*, __underscore bold__ and _underscore italic_ strings.
Expand Down
1 change: 0 additions & 1 deletion tests/data/markdown/code.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Code
Expand Down
8 changes: 1 addition & 7 deletions tests/data/markdown/footnotes.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Footnotes
Here is some random text!
Expand Down Expand Up @@ -27,13 +26,8 @@ profiles = [ "basic", "document",]

[config.custom_profiles.footnotes]
args_config = "default"
args_options = {html = false, linkify = true, typographer = true, breaks = true}
plugins = ["footnote"]
args = ["default", {html = false, linkify = true, typographer = true, breaks = true}]
[config.custom_profiles.footnotes.args_options_update]
html = false
linkify = true
typographer = true
breaks = true

[expected_output]
basic = "<h2>Footnotes</h2>\n<p>Here is some random text!</p>\n<p>Footnote 1 link[^first].</p>\n<p>Footnote 2 link[^second].</p>\n<p>Inline footnote^[Text of inline footnote] definition.</p>\n<p>Duplicated footnote reference[^second].</p>\n<p>[^first]: Footnote <strong>can have markup</strong></p>\n<pre><code>and multiple paragraphs.\n</code></pre>\n<p>[^second]: Footnote text.</p>\n<hr />\n<p>This is some more random text to test whether the footnotes are placed after this text.</p>"
Expand Down
7 changes: 0 additions & 7 deletions tests/data/markdown/headings.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
Using the heading-anchors plugin with it's default config:
Expand Down Expand Up @@ -30,12 +29,6 @@ profiles = [ "basic", "document",]
[config.custom_profiles.heading_anchors]
args_config = "default"
plugins = [ "heading_anchors",]
args = ["default", {html = false, linkify = true, typographer = true, breaks = true}]
[config.custom_profiles.heading_anchors.args_options_update]
html = false
linkify = true
typographer = true
breaks = true

[expected_output]
basic = "<p>Using the heading-anchors plugin with it's default config:</p>\n<p>The below headings should convert and get linked.<br />\nOnly the specified headings in extension defaults should get linked.</p>\n<h1>h1 Heading</h1>\n<h2>h2 Heading</h2>\n<h3>h3 Heading</h3>\n<h4>h4 Heading</h4>\n<h5>h5 Heading</h5>\n<h6>h6 Heading</h6>\n<hr />\n<p>The below headings should not convert due to lack of space between markup and text<br />\n#h1 Heading<br />\n##h2 Heading<br />\n###h3 Heading<br />\n####h4 Heading<br />\n#####h5 Heading<br />\n######h6 Heading</p>\n<h2>Text with 2 or more hyphens below it converts to H2</h2>"
Expand Down
1 change: 0 additions & 1 deletion tests/data/markdown/images.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Images
Expand Down
1 change: 0 additions & 1 deletion tests/data/markdown/links.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Links
Expand Down
1 change: 0 additions & 1 deletion tests/data/markdown/lists.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Lists
Expand Down
1 change: 0 additions & 1 deletion tests/data/markdown/tables.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[data]
markdown = """
## Tables
Expand Down
Loading

0 comments on commit 3ea2cfa

Please sign in to comment.