From 2ce19d9fd8f75ee1e3d62762e91f5d18303d4d6b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 11 Jul 2022 19:49:34 +0200 Subject: Add support for lazy lines --- tests/block_quote.rs | 55 +++++++++++++++++++++-------------------------- tests/character_escape.rs | 6 +++--- tests/code_indented.rs | 44 ++++++++++++++++++------------------- tests/heading_atx.rs | 10 ++++----- tests/heading_setext.rs | 33 +++++++++++++--------------- tests/html_flow.rs | 14 ++++++------ tests/thematic_break.rs | 10 ++++----- 7 files changed, 81 insertions(+), 91 deletions(-) (limited to 'tests') diff --git a/tests/block_quote.rs b/tests/block_quote.rs index c0b10b7..a448ece 100644 --- a/tests/block_quote.rs +++ b/tests/block_quote.rs @@ -27,19 +27,17 @@ fn block_quote() { "should not support block quotes w/ 4 spaces" ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> # a\n> b\nc"), - // "
\n

a

\n

b\nc

\n
", - // "should support lazy content lines" - // ); + assert_eq!( + micromark("> # a\n> b\nc"), + "
\n

a

\n

b\nc

\n
", + "should support lazy content lines" + ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> a\nb\n> c"), - // "
\n

a\nb\nc

\n
", - // "should support lazy content lines inside block quotes" - // ); + assert_eq!( + micromark("> a\nb\n> c"), + "
\n

a\nb\nc

\n
", + "should support lazy content lines inside block quotes" + ); assert_eq!( micromark("> a\n> ---"), @@ -134,12 +132,11 @@ fn block_quote() { "should support interrupting block quotes w/ thematic breaks" ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> a\nb"), - // "
\n

a\nb

\n
", - // "should not support interrupting block quotes w/ paragraphs" - // ); + assert_eq!( + micromark("> a\nb"), + "
\n

a\nb

\n
", + "should not support interrupting block quotes w/ paragraphs" + ); assert_eq!( micromark("> a\n\nb"), @@ -153,19 +150,17 @@ fn block_quote() { "should not support interrupting a blank line in a block quotes w/ paragraphs" ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> > > a\nb"), - // "
\n
\n
\n

a\nb

\n
\n
\n
", - // "should not support interrupting many block quotes w/ paragraphs (1)" - // ); + assert_eq!( + micromark("> > > a\nb"), + "
\n
\n
\n

a\nb

\n
\n
\n
", + "should not support interrupting many block quotes w/ paragraphs (1)" + ); - // To do: block quote (lazy). - // assert_eq!( - // micromark(">>> a\n> b\n>>c"), - // "
\n
\n
\n

a\nb\nc

\n
\n
\n
", - // "should not support interrupting many block quotes w/ paragraphs (2)" - // ); + assert_eq!( + micromark(">>> a\n> b\n>>c"), + "
\n
\n
\n

a\nb\nc

\n
\n
\n
", + "should not support interrupting many block quotes w/ paragraphs (2)" + ); assert_eq!( micromark("> a\n\n> b"), diff --git a/tests/character_escape.rs b/tests/character_escape.rs index 6200014..d27f20a 100644 --- a/tests/character_escape.rs +++ b/tests/character_escape.rs @@ -79,10 +79,10 @@ fn character_escape() { "should escape in fenced code info" ); - // // To do: turning things off - // assert_eq!( + // To do: turning things off + // assert_eq!( // micromark("\\> a", {extensions: [{disable: {null: ["characterEscape"]}}]}), // "

\\> a

", // "should support turning off character escapes" - // ); + // ); } diff --git a/tests/code_indented.rs b/tests/code_indented.rs index f462792..10281a2 100644 --- a/tests/code_indented.rs +++ b/tests/code_indented.rs @@ -16,11 +16,12 @@ fn code_indented() { // "should prefer list item content over indented code (1)" // ); - // assert_eq!( - // micromark("1. foo\n\n - bar"), - // "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
", - // "should prefer list item content over indented code (2)" - // ); + // To do: list. + // assert_eq!( + // micromark("1. foo\n\n - bar"), + // "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
", + // "should prefer list item content over indented code (2)" + // ); assert_eq!( micromark(" \n *hi*\n\n - one"), @@ -82,26 +83,23 @@ fn code_indented() { "should not support lazyness (1)" ); - // To do: blockquote (lazy). - // assert_eq!( - // micromark("> a\n b"), - // "
\n

a\nb

\n
", - // "should not support lazyness (2)" - // ); + assert_eq!( + micromark("> a\n b"), + "
\n

a\nb

\n
", + "should not support lazyness (2)" + ); - // To do: blockquote (lazy). - // assert_eq!( - // micromark("> a\n b"), - // "
\n

a\nb

\n
", - // "should not support lazyness (3)" - // ); + assert_eq!( + micromark("> a\n b"), + "
\n

a\nb

\n
", + "should not support lazyness (3)" + ); - // To do: blockquote (lazy). - // assert_eq!( - // micromark("> a\n b"), - // "
\n

a\nb

\n
", - // "should not support lazyness (4)" - // ); + assert_eq!( + micromark("> a\n b"), + "
\n

a\nb

\n
", + "should not support lazyness (4)" + ); assert_eq!( micromark("> a\n b"), diff --git a/tests/heading_atx.rs b/tests/heading_atx.rs index b7c87fe..530ddc5 100644 --- a/tests/heading_atx.rs +++ b/tests/heading_atx.rs @@ -188,11 +188,11 @@ fn heading_atx() { "should not support lazyness (1)" ); - // assert_eq!( - // micromark("> a\n#"), - // "
\n

a

\n
\n

", - // "should not support lazyness (2)" - // ); + assert_eq!( + micromark("> a\n#"), + "
\n

a

\n
\n

", + "should not support lazyness (2)" + ); // To do: turning things off: // assert_eq!( diff --git a/tests/heading_setext.rs b/tests/heading_setext.rs index a42b8e5..0e0c34c 100644 --- a/tests/heading_setext.rs +++ b/tests/heading_setext.rs @@ -135,12 +135,11 @@ fn heading_setext() { "should not allow underline to be lazy (1)" ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> foo\nbar\n==="), - // "
\n

foo\nbar\n===

\n
", - // "should not allow underline to be lazy (2)" - // ); + assert_eq!( + micromark("> foo\nbar\n==="), + "
\n

foo\nbar\n===

\n
", + "should not allow underline to be lazy (2)" + ); // To do: list. // assert_eq!( @@ -247,19 +246,17 @@ fn heading_setext() { "should prefer a setext heading over an interrupting list" ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> ===\na"), - // "
\n

===\na

\n
", - // "should not support lazyness (1)" - // ); + assert_eq!( + micromark("> ===\na"), + "
\n

===\na

\n
", + "should not support lazyness (1)" + ); - // To do: block quote (lazy). - // assert_eq!( - // micromark("> a\n==="), - // "
\n

a\n===

\n
", - // "should not support lazyness (2)" - // ); + assert_eq!( + micromark("> a\n==="), + "
\n

a\n===

\n
", + "should not support lazyness (2)" + ); // To do: turning things off. // assert_eq!( diff --git a/tests/html_flow.rs b/tests/html_flow.rs index 6dfceb5..1f88dbc 100644 --- a/tests/html_flow.rs +++ b/tests/html_flow.rs @@ -385,13 +385,13 @@ fn html_flow_4_declaration() { #[test] fn html_flow_5_cdata() { assert_eq!( - micromark_with_options( - "\nokay", - DANGER - ), - "\n

okay

", - "should support cdata (type 5)" - ); + micromark_with_options( + "\nokay", + DANGER + ), + "\n

okay

", + "should support cdata (type 5)" + ); assert_eq!( micromark_with_options("", DANGER), diff --git a/tests/thematic_break.rs b/tests/thematic_break.rs index 7a15c32..61fee72 100644 --- a/tests/thematic_break.rs +++ b/tests/thematic_break.rs @@ -161,11 +161,11 @@ fn thematic_break() { "should not support lazyness (1)" ); - // assert_eq!( - // micromark("> a\n---"), - // "
\n

a

\n
\n
", - // "should not support lazyness (2)" - // ); + assert_eq!( + micromark("> a\n---"), + "
\n

a

\n
\n
", + "should not support lazyness (2)" + ); // To do: turning things off. // assert_eq!( -- cgit