aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-08 13:26:23 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-08 13:26:23 +0200
commitc1b325a6dcf4bb8795dd2e5b2cdb1dcfcf61faf5 (patch)
treea94fc69206c3d493028845030f5d9beb3fce48bd /tests
parentbd0cb0d0395abb06941960938aacc3639148a96c (diff)
downloadmarkdown-rs-c1b325a6dcf4bb8795dd2e5b2cdb1dcfcf61faf5.tar.gz
markdown-rs-c1b325a6dcf4bb8795dd2e5b2cdb1dcfcf61faf5.tar.bz2
markdown-rs-c1b325a6dcf4bb8795dd2e5b2cdb1dcfcf61faf5.zip
Fix closing of flow when exiting containers
Diffstat (limited to '')
-rw-r--r--tests/block_quote.rs26
-rw-r--r--tests/code_fenced.rs4
-rw-r--r--tests/code_indented.rs11
-rw-r--r--tests/definition.rs11
-rw-r--r--tests/html_flow.rs77
5 files changed, 59 insertions, 70 deletions
diff --git a/tests/block_quote.rs b/tests/block_quote.rs
index 02256e1..af9e9d9 100644
--- a/tests/block_quote.rs
+++ b/tests/block_quote.rs
@@ -47,12 +47,11 @@ fn block_quote() {
"should support setext headings underlines in block quotes"
);
- // To do: block quote (lazy, setext underline)
- // assert_eq!(
- // micromark("> a\n---"),
- // "<blockquote>\n<p>a</p>\n</blockquote>\n<hr />",
- // "should not support lazy setext headings underlines in block quotes"
- // );
+ assert_eq!(
+ micromark("> a\n---"),
+ "<blockquote>\n<p>a</p>\n</blockquote>\n<hr />",
+ "should not support lazy setext headings underlines in block quotes"
+ );
// To do: list.
// assert_eq!(
@@ -156,26 +155,25 @@ fn block_quote() {
"should not support interrupting a blank line in a block quotes w/ paragraphs"
);
- // To do: block quote (multi, lazy).
+ // To do: block quote (lazy).
// assert_eq!(
// micromark("> > > a\nb"),
// "<blockquote>\n<blockquote>\n<blockquote>\n<p>a\nb</p>\n</blockquote>\n</blockquote>\n</blockquote>",
// "should not support interrupting many block quotes w/ paragraphs (1)"
// );
- // To do: block quote (multi, lazy).
+ // To do: block quote (lazy).
// assert_eq!(
// micromark(">>> a\n> b\n>>c"),
// "<blockquote>\n<blockquote>\n<blockquote>\n<p>a\nb\nc</p>\n</blockquote>\n</blockquote>\n</blockquote>",
// "should not support interrupting many block quotes w/ paragraphs (2)"
// );
- // To do: block quote (exit flow if container exits).
- // assert_eq!(
- // micromark("> a\n\n> b"),
- // "<blockquote>\n<pre><code>a\n</code></pre>\n</blockquote>\n<blockquote>\n<p>b</p>\n</blockquote>",
- // "should support 5 spaces for indented code, not 4"
- // );
+ assert_eq!(
+ micromark("> a\n\n> b"),
+ "<blockquote>\n<pre><code>a\n</code></pre>\n</blockquote>\n<blockquote>\n<p>b</p>\n</blockquote>",
+ "should support 5 spaces for indented code, not 4"
+ );
// To do: turning things off.
// assert_eq!(
diff --git a/tests/code_fenced.rs b/tests/code_fenced.rs
index 84d0d83..29ef62a 100644
--- a/tests/code_fenced.rs
+++ b/tests/code_fenced.rs
@@ -234,7 +234,7 @@ fn code_fenced() {
// "should not support a closing sequence w/ too much indent, regardless of opening sequence (2)"
// );
- // To do: blockquote (some bug).
+ // To do: blockquote (some bug, perhaps compiler).
// assert_eq!(
// micromark("> ```a\nb"),
// "<blockquote>\n<pre><code class=\"language-a\"></code></pre>\n</blockquote>\n<p>b</p>",
@@ -247,7 +247,7 @@ fn code_fenced() {
"should not support lazyness (2)"
);
- // To do: blockquote (lazy).
+ // To do: blockquote (some bug, also compiler).
// assert_eq!(
// micromark("> ```a\n```"),
// "<blockquote>\n<pre><code class=\"language-a\"></code></pre>\n</blockquote>\n<pre><code></code></pre>\n",
diff --git a/tests/code_indented.rs b/tests/code_indented.rs
index d7cf181..ba1b483 100644
--- a/tests/code_indented.rs
+++ b/tests/code_indented.rs
@@ -76,12 +76,11 @@ fn code_indented() {
"should support trailing whitespace"
);
- // To do: blockquote (some bug).
- // assert_eq!(
- // micromark("> a\nb"),
- // "<blockquote>\n<pre><code>a\n</code></pre>\n</blockquote>\n<p>b</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark("> a\nb"),
+ "<blockquote>\n<pre><code>a\n</code></pre>\n</blockquote>\n<p>b</p>",
+ "should not support lazyness (1)"
+ );
// To do: blockquote (lazy).
// assert_eq!(
diff --git a/tests/definition.rs b/tests/definition.rs
index ca8b97c..ffb3460 100644
--- a/tests/definition.rs
+++ b/tests/definition.rs
@@ -192,12 +192,11 @@ fn definition() {
"should support definitions after definitions"
);
- // To do: block quote (some bug).
- // assert_eq!(
- // micromark("> [foo]: /url\n\n[foo]"),
- // "<blockquote>\n</blockquote>\n<p><a href=\"/url\">foo</a></p>",
- // "should support definitions in block quotes"
- // );
+ assert_eq!(
+ micromark("> [foo]: /url\n\n[foo]"),
+ "<blockquote>\n</blockquote>\n<p><a href=\"/url\">foo</a></p>",
+ "should support definitions in block quotes"
+ );
// Extra
assert_eq!(
diff --git a/tests/html_flow.rs b/tests/html_flow.rs
index 796ced4..71e7bbe 100644
--- a/tests/html_flow.rs
+++ b/tests/html_flow.rs
@@ -171,12 +171,11 @@ p {color:blue;}
"should support blank lines in raw"
);
- // To do: block quote (lazy).
- // assert_eq!(
- // micromark_with_options("> <script>\na", DANGER),
- // "<blockquote>\n<script>\n</blockquote>\n<p>a</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <script>\na", DANGER),
+ "<blockquote>\n<script>\n</blockquote>\n<p>a</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<script>", DANGER),
@@ -270,12 +269,11 @@ fn html_flow_2_comment() {
"should support blank lines in comments"
);
- // To do: blockquote (lazy).
- // assert_eq!(
- // micromark_with_options("> <!--\na", DANGER),
- // "<blockquote>\n<!--\n</blockquote>\n<p>a</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <!--\na", DANGER),
+ "<blockquote>\n<!--\n</blockquote>\n<p>a</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<!--", DANGER),
@@ -317,12 +315,11 @@ fn html_flow_3_instruction() {
"should support blank lines in instructions"
);
- // To do: blockquote (lazy).
- // assert_eq!(
- // micromark_with_options("> <?\na", DANGER),
- // "<blockquote>\n<?\n</blockquote>\n<p>a</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <?\na", DANGER),
+ "<blockquote>\n<?\n</blockquote>\n<p>a</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<?", DANGER),
@@ -372,12 +369,11 @@ fn html_flow_4_declaration() {
"should support blank lines in declarations"
);
- // To do: blockquote (lazy).
- // assert_eq!(
- // micromark_with_options("> <!a\nb", DANGER),
- // "<blockquote>\n<!a\n</blockquote>\n<p>b</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <!a\nb", DANGER),
+ "<blockquote>\n<!a\n</blockquote>\n<p>b</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<!b", DANGER),
@@ -436,12 +432,11 @@ fn html_flow_5_cdata() {
"should support blank lines in cdata"
);
- // To do: blockquote (lazy).
- // assert_eq!(
- // micromark_with_options("> <![CDATA[\na", DANGER),
- // "<blockquote>\n<![CDATA[\n</blockquote>\n<p>a</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <![CDATA[\na", DANGER),
+ "<blockquote>\n<![CDATA[\n</blockquote>\n<p>a</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<![CDATA[", DANGER),
@@ -715,12 +710,11 @@ okay.",
"should not support blank lines in basic"
);
- // To do: block quote (some bug).
- // assert_eq!(
- // micromark_with_options("> <div\na", DANGER),
- // "<blockquote>\n<div\n</blockquote>\n<p>a</p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <div\na", DANGER),
+ "<blockquote>\n<div\n</blockquote>\n<p>a</p>",
+ "should not support lazyness (1)"
+ );
assert_eq!(
micromark_with_options("> a\n<div", DANGER),
@@ -1019,12 +1013,11 @@ fn html_flow_7_complete() {
"should not support blank lines in complete"
);
- // To do: containers: close flow when closing container.
- // assert_eq!(
- // micromark_with_options("> <a>\n*bar*", DANGER),
- // "<blockquote>\n<a>\n</blockquote>\n<p><em>bar</em></p>",
- // "should not support lazyness (1)"
- // );
+ assert_eq!(
+ micromark_with_options("> <a>\n*bar*", DANGER),
+ "<blockquote>\n<a>\n</blockquote>\n<p><em>bar</em></p>",
+ "should not support lazyness (1)"
+ );
// To do: blockquote (lazy).
// assert_eq!(