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/block_quote.rs | 74 ++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'tests/block_quote.rs') diff --git a/tests/block_quote.rs b/tests/block_quote.rs index 9d967ee..970b82e 100644 --- a/tests/block_quote.rs +++ b/tests/block_quote.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{BlockQuote, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -10,199 +10,199 @@ use pretty_assertions::assert_eq; #[test] fn block_quote() -> Result<(), String> { assert_eq!( - micromark("> # a\n> b\n> c"), + to_html("> # a\n> b\n> c"), "
\n

a

\n

b\nc

\n
", "should support block quotes" ); assert_eq!( - micromark("># a\n>b\n> c"), + to_html("># a\n>b\n> c"), "
\n

a

\n

b\nc

\n
", "should support block quotes w/o space" ); assert_eq!( - micromark(" > # a\n > b\n > c"), + to_html(" > # a\n > b\n > c"), "
\n

a

\n

b\nc

\n
", "should support prefixing block quotes w/ spaces" ); assert_eq!( - micromark(" > # a\n > b\n > c"), + to_html(" > # a\n > b\n > c"), "
> # a\n> b\n> c\n
", "should not support block quotes w/ 4 spaces" ); assert_eq!( - micromark("> # a\n> b\nc"), + to_html("> # a\n> b\nc"), "
\n

a

\n

b\nc

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

a\nb\nc

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

a

\n
", "should support setext headings underlines in block quotes" ); assert_eq!( - micromark("> a\n---"), + to_html("> a\n---"), "
\n

a

\n
\n
", "should not support lazy setext headings underlines in block quotes" ); assert_eq!( - micromark("> - a\n> - b"), + to_html("> - a\n> - b"), "
\n\n
", "should support lists in block quotes" ); assert_eq!( - micromark("> - a\n- b"), + to_html("> - a\n- b"), "
\n\n
\n", "should not support lazy lists in block quotes" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
b\n
", "should not support lazy indented code in block quotes" ); assert_eq!( - micromark("> ```\na\n```"), + to_html("> ```\na\n```"), "
\n
\n
\n

a

\n
\n", "should not support lazy fenced code in block quotes (1)" ); assert_eq!( - micromark("> a\n```\nb"), + to_html("> a\n```\nb"), "
\n

a

\n
\n
b\n
\n", "should not support lazy fenced code in block quotes (2)" ); assert_eq!( - micromark("> a\n - b"), + to_html("> a\n - b"), "
\n

a\n- b

\n
", "should not support lazy indented code (or lazy list) in block quotes" ); assert_eq!( - micromark("> [\na"), + to_html("> [\na"), "
\n

[\na

\n
", "should support lazy, definition-like lines" ); assert_eq!( - micromark("> [a]: b\nc"), + to_html("> [a]: b\nc"), "
\n

c

\n
", "should support a definition, followed by a lazy paragraph" ); assert_eq!( - micromark(">"), + to_html(">"), "
\n
", "should support empty block quotes (1)" ); assert_eq!( - micromark(">\n> \n> "), + to_html(">\n> \n> "), "
\n
", "should support empty block quotes (2)" ); assert_eq!( - micromark(">\n> a\n> "), + to_html(">\n> a\n> "), "
\n

a

\n
", "should support initial or final lazy empty block quote lines" ); assert_eq!( - micromark("> a\n\n> b"), + to_html("> a\n\n> b"), "
\n

a

\n
\n
\n

b

\n
", "should support adjacent block quotes" ); assert_eq!( - micromark("> a\n> b"), + to_html("> a\n> b"), "
\n

a\nb

\n
", "should support a paragraph in a block quote" ); assert_eq!( - micromark("> a\n>\n> b"), + to_html("> a\n>\n> b"), "
\n

a

\n

b

\n
", "should support adjacent paragraphs in block quotes" ); assert_eq!( - micromark("[a]\n\n> [a]: b"), + to_html("[a]\n\n> [a]: b"), "

a

\n
\n
", "should support a definition in a block quote (1)" ); assert_eq!( - micromark("> [a]: b\n\n[a]"), + to_html("> [a]: b\n\n[a]"), "
\n
\n

a

", "should support a definition in a block quote (2)" ); assert_eq!( - micromark("a\n> b"), + to_html("a\n> b"), "

a

\n
\n

b

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

a

\n
\n
\n
\n

b

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

a\nb

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

a

\n
\n

b

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

a

\n
\n

b

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

a\nb

\n
\n
\n
", "should not support interrupting many block quotes w/ paragraphs (1)" ); assert_eq!( - micromark(">>> a\n> b\n>>c"), + to_html(">>> 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"), + to_html("> a\n\n> b"), "
\n
a\n
\n
\n
\n

b

\n
", "should support 5 spaces for indented code, not 4" ); assert_eq!( - micromark_with_options( + to_html_with_options( "> # a\n> b\n> c", &Options { parse: ParseOptions { @@ -220,7 +220,7 @@ fn block_quote() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("> a", &ParseOptions::default())?, + to_mdast("> a", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::BlockQuote(BlockQuote { children: vec![Node::Paragraph(Paragraph { -- cgit