From ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 10:40:01 +0200 Subject: Rename crate to `markdown` --- tests/thematic_break.rs | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'tests/thematic_break.rs') diff --git a/tests/thematic_break.rs b/tests/thematic_break.rs index c5612bb..735829d 100644 --- a/tests/thematic_break.rs +++ b/tests/thematic_break.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Root, ThematicBreak}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -10,169 +10,169 @@ use pretty_assertions::assert_eq; #[test] fn thematic_break() -> Result<(), String> { assert_eq!( - micromark("***\n---\n___"), + to_html("***\n---\n___"), "
\n
\n
", "should support thematic breaks w/ asterisks, dashes, and underscores" ); assert_eq!( - micromark("+++"), + to_html("+++"), "

+++

", "should not support thematic breaks w/ plusses" ); assert_eq!( - micromark("==="), + to_html("==="), "

===

", "should not support thematic breaks w/ equals" ); assert_eq!( - micromark("--"), + to_html("--"), "

--

", "should not support thematic breaks w/ two dashes" ); assert_eq!( - micromark("**"), + to_html("**"), "

**

", "should not support thematic breaks w/ two asterisks" ); assert_eq!( - micromark("__"), + to_html("__"), "

__

", "should not support thematic breaks w/ two underscores" ); assert_eq!( - micromark(" ***"), + to_html(" ***"), "
", "should support thematic breaks w/ 1 space" ); assert_eq!( - micromark(" ***"), + to_html(" ***"), "
", "should support thematic breaks w/ 2 spaces" ); assert_eq!( - micromark(" ***"), + to_html(" ***"), "
", "should support thematic breaks w/ 3 spaces" ); assert_eq!( - micromark(" ***"), + to_html(" ***"), "
***\n
", "should not support thematic breaks w/ 4 spaces" ); assert_eq!( - micromark("Foo\n ***"), + to_html("Foo\n ***"), "

Foo\n***

", "should not support thematic breaks w/ 4 spaces as paragraph continuation" ); assert_eq!( - micromark("_____________________________________"), + to_html("_____________________________________"), "
", "should support thematic breaks w/ many markers" ); assert_eq!( - micromark(" - - -"), + to_html(" - - -"), "
", "should support thematic breaks w/ spaces (1)" ); assert_eq!( - micromark(" ** * ** * ** * **"), + to_html(" ** * ** * ** * **"), "
", "should support thematic breaks w/ spaces (2)" ); assert_eq!( - micromark("- - - -"), + to_html("- - - -"), "
", "should support thematic breaks w/ spaces (3)" ); assert_eq!( - micromark("- - - - "), + to_html("- - - - "), "
", "should support thematic breaks w/ trailing spaces" ); assert_eq!( - micromark("_ _ _ _ a"), + to_html("_ _ _ _ a"), "

_ _ _ _ a

", "should not support thematic breaks w/ other characters (1)" ); assert_eq!( - micromark("a------"), + to_html("a------"), "

a------

", "should not support thematic breaks w/ other characters (2)" ); assert_eq!( - micromark("---a---"), + to_html("---a---"), "

---a---

", "should not support thematic breaks w/ other characters (3)" ); assert_eq!( - micromark(" *-*"), + to_html(" *-*"), "

-

", "should not support thematic breaks w/ mixed markers" ); assert_eq!( - micromark("- foo\n***\n- bar"), + to_html("- foo\n***\n- bar"), "\n
\n", "should support thematic breaks mixed w/ lists (1)" ); assert_eq!( - micromark("* Foo\n* * *\n* Bar"), + to_html("* Foo\n* * *\n* Bar"), "\n
\n", "should support thematic breaks mixed w/ lists (2)" ); assert_eq!( - micromark("Foo\n***\nbar"), + to_html("Foo\n***\nbar"), "

Foo

\n
\n

bar

", "should support thematic breaks interrupting paragraphs" ); assert_eq!( - micromark("Foo\n---\nbar"), + to_html("Foo\n---\nbar"), "

Foo

\n

bar

", "should not support thematic breaks w/ dashes interrupting paragraphs (setext heading)" ); assert_eq!( - micromark("- Foo\n- * * *"), + to_html("- Foo\n- * * *"), "", "should support thematic breaks in lists" ); assert_eq!( - micromark("> ---\na"), + to_html("> ---\na"), "
\n
\n
\n

a

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

a

\n
\n
", "should not support lazyness (2)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "***", &Options { parse: ParseOptions { @@ -190,7 +190,7 @@ fn thematic_break() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("***", &ParseOptions::default())?, + to_mdast("***", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::ThematicBreak(ThematicBreak { position: Some(Position::new(1, 1, 0, 1, 4, 3)) -- cgit