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/code_indented.rs | 64 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'tests/code_indented.rs') diff --git a/tests/code_indented.rs b/tests/code_indented.rs index b02b092..6545ed6 100644 --- a/tests/code_indented.rs +++ b/tests/code_indented.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Code, Node, Root}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -10,115 +10,115 @@ use pretty_assertions::assert_eq; #[test] fn code_indented() -> Result<(), String> { assert_eq!( - micromark(" a simple\n indented code block"), + to_html(" a simple\n indented code block"), "
a simple\n  indented code block\n
", "should support indented code" ); assert_eq!( - micromark(" - foo\n\n bar"), + to_html(" - foo\n\n bar"), "", "should prefer list item content over indented code (1)" ); assert_eq!( - micromark("1. foo\n\n - bar"), + to_html("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"), + to_html(" \n *hi*\n\n - one"), "
<a/>\n*hi*\n\n- one\n
", "should support blank lines in indented code (1)" ); assert_eq!( - micromark(" chunk1\n\n chunk2\n \n \n \n chunk3"), + to_html(" chunk1\n\n chunk2\n \n \n \n chunk3"), "
chunk1\n\nchunk2\n\n\n\nchunk3\n
", "should support blank lines in indented code (2)" ); assert_eq!( - micromark(" chunk1\n \n chunk2"), + to_html(" chunk1\n \n chunk2"), "
chunk1\n  \n  chunk2\n
", "should support blank lines in indented code (3)" ); assert_eq!( - micromark("Foo\n bar"), + to_html("Foo\n bar"), "

Foo\nbar

", "should not support interrupting paragraphs" ); assert_eq!( - micromark(" foo\nbar"), + to_html(" foo\nbar"), "
foo\n
\n

bar

", "should support paragraphs directly after indented code" ); assert_eq!( - micromark("# Heading\n foo\nHeading\n------\n foo\n----"), + to_html("# Heading\n foo\nHeading\n------\n foo\n----"), "

Heading

\n
foo\n
\n

Heading

\n
foo\n
\n
", "should mix w/ other content" ); assert_eq!( - micromark(" foo\n bar"), + to_html(" foo\n bar"), "
    foo\nbar\n
", "should support extra whitespace on the first line" ); assert_eq!( - micromark("\n \n foo\n "), + to_html("\n \n foo\n "), "
foo\n
", "should not support initial blank lines" ); assert_eq!( - micromark(" foo "), + to_html(" foo "), "
foo  \n
", "should support trailing whitespace" ); assert_eq!( - micromark("> a\nb"), + to_html("> a\nb"), "
\n
a\n
\n
\n

b

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

a\nb

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

a\nb

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

a\nb

\n
", "should not support lazyness (4)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
b\n
", "should not support lazyness (5)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
 b\n
", "should not support lazyness (6)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
  b\n
", "should not support lazyness (7)" ); @@ -135,43 +135,43 @@ fn code_indented() -> Result<(), String> { }; assert_eq!( - micromark_with_options(" a", &off)?, + to_html_with_options(" a", &off)?, "

a

", "should support turning off code (indented, 1)" ); assert_eq!( - micromark_with_options("> a\n b", &off)?, + to_html_with_options("> a\n b", &off)?, "
\n

a\nb

\n
", "should support turning off code (indented, 2)" ); assert_eq!( - micromark_with_options("- a\n b", &off)?, + to_html_with_options("- a\n b", &off)?, "", "should support turning off code (indented, 3)" ); assert_eq!( - micromark_with_options("- a\n - b", &off)?, + to_html_with_options("- a\n - b", &off)?, "", "should support turning off code (indented, 4)" ); assert_eq!( - micromark_with_options("- a\n - b", &off)?, + to_html_with_options("- a\n - b", &off)?, "", "should support turning off code (indented, 5)" ); assert_eq!( - micromark_with_options("```\na\n ```", &off)?, + to_html_with_options("```\na\n ```", &off)?, "
a\n
", "should support turning off code (indented, 6)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ", &Options { parse: ParseOptions { @@ -192,19 +192,19 @@ fn code_indented() -> Result<(), String> { ); assert_eq!( - micromark_with_options("- Foo\n---", &off)?, + to_html_with_options("- Foo\n---", &off)?, "\n
", "should support turning off code (indented, 8)" ); assert_eq!( - micromark_with_options("- Foo\n ---", &off)?, + to_html_with_options("- Foo\n ---", &off)?, "", "should support turning off code (indented, 9)" ); assert_eq!( - micromark_to_mdast( + to_mdast( "\tconsole.log(1)\n console.log(2)\n", &ParseOptions::default() )?, -- cgit