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/character_reference.rs | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'tests/character_reference.rs') diff --git a/tests/character_reference.rs b/tests/character_reference.rs index 4e9a436..2d5c6df 100644 --- a/tests/character_reference.rs +++ b/tests/character_reference.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -10,7 +10,7 @@ use pretty_assertions::assert_eq; #[test] fn character_reference() -> Result<(), String> { assert_eq!( - micromark( + to_html( "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸" ), "

\u{a0} & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

", @@ -18,38 +18,38 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark("# Ӓ Ϡ �"), + to_html("# Ӓ Ϡ �"), "

# Ӓ Ϡ �

", "should support decimal character references" ); assert_eq!( - micromark("" ആ ಫ"), + to_html("" ആ ಫ"), "

" ആ ಫ

", "should support hexadecimal character references" ); assert_eq!( - micromark( + to_html( "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"), "

&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

", "should not support other things that look like character references" ); assert_eq!( - micromark("©"), + to_html("©"), "

&copy

", "should not support character references w/o semicolon" ); assert_eq!( - micromark("&MadeUpEntity;"), + to_html("&MadeUpEntity;"), "

&MadeUpEntity;

", "should not support unknown named character references" ); assert_eq!( - micromark_with_options( + to_html_with_options( "", &Options { compile: CompileOptions { @@ -65,140 +65,140 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark("[foo](/föö \"föö\")"), + to_html("[foo](/föö \"föö\")"), "

foo

", "should support character references in resource URLs and titles" ); assert_eq!( - micromark("[foo]: /föö \"föö\"\n\n[foo]"), + to_html("[foo]: /föö \"föö\"\n\n[foo]"), "

foo

", "should support character references in definition URLs and titles" ); assert_eq!( - micromark("``` föö\nfoo\n```"), + to_html("``` föö\nfoo\n```"), "
foo\n
", "should support character references in code language" ); assert_eq!( - micromark("`föö`"), + to_html("`föö`"), "

f&ouml;&ouml;

", "should not support character references in text code" ); assert_eq!( - micromark(" föfö"), + to_html(" föfö"), "
f&ouml;f&ouml;\n
", "should not support character references in indented code" ); assert_eq!( - micromark("*foo*\n*foo*"), + to_html("*foo*\n*foo*"), "

*foo*\nfoo

", "should not support character references as construct markers (1)" ); assert_eq!( - micromark("* foo\n\n* foo"), + to_html("* foo\n\n* foo"), "

* foo

\n", "should not support character references as construct markers (2)" ); assert_eq!( - micromark("[a](url "tit")"), + to_html("[a](url "tit")"), "

[a](url "tit")

", "should not support character references as construct markers (3)" ); assert_eq!( - micromark("foo bar"), + to_html("foo bar"), "

foo\n\nbar

", "should not support character references as whitespace (1)" ); assert_eq!( - micromark(" foo"), + to_html(" foo"), "

\tfoo

", "should not support character references as whitespace (2)" ); // Extra: assert_eq!( - micromark("∳"), + to_html("∳"), "

", "should support the longest possible named character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

", "should “support” a longest possible hexadecimal character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

", "should “support” a longest possible decimal character reference" ); assert_eq!( - micromark("&CounterClockwiseContourIntegrali;"), + to_html("&CounterClockwiseContourIntegrali;"), "

&CounterClockwiseContourIntegrali;

", "should not support the longest possible named character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

&#xff99999;

", "should not support a longest possible hexadecimal character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

&#99999999;

", "should not support a longest possible decimal character reference" ); assert_eq!( - micromark("&-;"), + to_html("&-;"), "

&-;

", "should not support the other characters after `&`" ); assert_eq!( - micromark("&#-;"), + to_html("&#-;"), "

&#-;

", "should not support the other characters after `#`" ); assert_eq!( - micromark("&#x-;"), + to_html("&#x-;"), "

&#x-;

", "should not support the other characters after `#x`" ); assert_eq!( - micromark("<-;"), + to_html("<-;"), "

&lt-;

", "should not support the other characters inside a name" ); assert_eq!( - micromark(" -;"), + to_html(" -;"), "

&#9-;

", "should not support the other characters inside a demical" ); assert_eq!( - micromark(" -;"), + to_html(" -;"), "

&#x9-;

", "should not support the other characters inside a hexademical" ); assert_eq!( - micromark_with_options( + to_html_with_options( "&", &Options { parse: ParseOptions { @@ -216,7 +216,7 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸", &ParseOptions::default())?, + to_mdast("  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![Node::Text(Text { -- cgit