From 879fbf500d0aef45cf5811569a53510013440bcd Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 12 Jul 2022 17:53:05 +0200 Subject: Fix to prefer thematic breaks over lists --- tests/heading_setext.rs | 11 +++++----- tests/misc_tabs.rs | 24 ++++++++++----------- tests/thematic_break.rs | 55 ++++++++++++++++++++++--------------------------- 3 files changed, 41 insertions(+), 49 deletions(-) (limited to 'tests') diff --git a/tests/heading_setext.rs b/tests/heading_setext.rs index 4e2a046..8d4a5b7 100644 --- a/tests/heading_setext.rs +++ b/tests/heading_setext.rs @@ -213,12 +213,11 @@ fn heading_setext() { "paragraph and heading interplay (3)" ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("Foo\nbar\n* * *\nbaz"), - // "

Foo\nbar

\n
\n

baz

", - // "paragraph and heading interplay (4)" - // ); + assert_eq!( + micromark("Foo\nbar\n* * *\nbaz"), + "

Foo\nbar

\n
\n

baz

", + "paragraph and heading interplay (4)" + ); assert_eq!( micromark("Foo\nbar\n\\---\nbaz"), diff --git a/tests/misc_tabs.rs b/tests/misc_tabs.rs index e7aad07..e82738d 100644 --- a/tests/misc_tabs.rs +++ b/tests/misc_tabs.rs @@ -123,19 +123,17 @@ fn tabs_flow() { "should support tabs in HTML (if whitespace is allowed)" ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("*\t*\t*\t"), - // "
", - // "should support tabs in thematic breaks" - // ); - - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("*\t\t*\t\t*\t\t"), - // "
", - // "should support arbitrary tabs in thematic breaks" - // ); + assert_eq!( + micromark("*\t*\t*\t"), + "
", + "should support tabs in thematic breaks" + ); + + assert_eq!( + micromark("*\t\t*\t\t*\t\t"), + "
", + "should support arbitrary tabs in thematic breaks" + ); } #[test] diff --git a/tests/thematic_break.rs b/tests/thematic_break.rs index 02be90f..0cedada 100644 --- a/tests/thematic_break.rs +++ b/tests/thematic_break.rs @@ -75,12 +75,11 @@ fn thematic_break() { "should support thematic breaks w/ many markers" ); - // To do: list (should prefer thematic break). - // assert_eq!( - // micromark(" - - -"), - // "
", - // "should support thematic breaks w/ spaces (1)" - // ); + assert_eq!( + micromark(" - - -"), + "
", + "should support thematic breaks w/ spaces (1)" + ); assert_eq!( micromark(" ** * ** * ** * **"), @@ -88,19 +87,17 @@ fn thematic_break() { "should support thematic breaks w/ spaces (2)" ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("- - - -"), - // "
", - // "should support thematic breaks w/ spaces (3)" - // ); + assert_eq!( + micromark("- - - -"), + "
", + "should support thematic breaks w/ spaces (3)" + ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("- - - - "), - // "
", - // "should support thematic breaks w/ trailing spaces" - // ); + assert_eq!( + micromark("- - - - "), + "
", + "should support thematic breaks w/ trailing spaces" + ); assert_eq!( micromark("_ _ _ _ a"), @@ -132,12 +129,11 @@ fn thematic_break() { "should support thematic breaks mixed w/ lists (1)" ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("* Foo\n* * *\n* Bar"), - // "\n
\n", - // "should support thematic breaks mixed w/ lists (2)" - // ); + assert_eq!( + micromark("* Foo\n* * *\n* Bar"), + "\n
\n", + "should support thematic breaks mixed w/ lists (2)" + ); assert_eq!( micromark("Foo\n***\nbar"), @@ -151,12 +147,11 @@ fn thematic_break() { "should not support thematic breaks w/ dashes interrupting paragraphs (setext heading)" ); - // To do: list (prefer thematic break). - // assert_eq!( - // micromark("- Foo\n- * * *"), - // "", - // "should support thematic breaks in lists" - // ); + assert_eq!( + micromark("- Foo\n- * * *"), + "", + "should support thematic breaks in lists" + ); assert_eq!( micromark("> ---\na"), -- cgit