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/misc_tabs.rs | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'tests/misc_tabs.rs') diff --git a/tests/misc_tabs.rs b/tests/misc_tabs.rs index 56698e8..5de8de2 100644 --- a/tests/misc_tabs.rs +++ b/tests/misc_tabs.rs @@ -1,5 +1,5 @@ -extern crate micromark; -use micromark::{micromark, micromark_with_options, CompileOptions, Options}; +extern crate markdown; +use markdown::{to_html, to_html_with_options, CompileOptions, Options}; use pretty_assertions::assert_eq; #[test] @@ -14,121 +14,121 @@ fn tabs_flow() -> Result<(), String> { }; assert_eq!( - micromark(" x"), + to_html(" x"), "
x\n
", "should support a 4*SP to start code" ); assert_eq!( - micromark("\tx"), + to_html("\tx"), "
x\n
", "should support a HT to start code" ); assert_eq!( - micromark(" \tx"), + to_html(" \tx"), "
x\n
", "should support a SP + HT to start code" ); assert_eq!( - micromark(" \tx"), + to_html(" \tx"), "
x\n
", "should support a 2*SP + HT to start code" ); assert_eq!( - micromark(" \tx"), + to_html(" \tx"), "
x\n
", "should support a 3*SP + HT to start code" ); assert_eq!( - micromark(" \tx"), + to_html(" \tx"), "
\tx\n
", "should support a 4*SP to start code, and leave the next HT as code data" ); assert_eq!( - micromark(" \t# x"), + to_html(" \t# x"), "
# x\n
", "should not support a 3*SP + HT to start an ATX heading" ); assert_eq!( - micromark(" \t> x"), + to_html(" \t> x"), "
> x\n
", "should not support a 3*SP + HT to start a block quote" ); assert_eq!( - micromark(" \t- x"), + to_html(" \t- x"), "
- x\n
", "should not support a 3*SP + HT to start a list item" ); assert_eq!( - micromark(" \t---"), + to_html(" \t---"), "
---\n
", "should not support a 3*SP + HT to start a thematic break" ); assert_eq!( - micromark(" \t```"), + to_html(" \t```"), "
```\n
", "should not support a 3*SP + HT to start a fenced code" ); assert_eq!( - micromark(" \t
"), + to_html(" \t
"), "
<div>\n
", "should not support a 3*SP + HT to start HTML" ); assert_eq!( - micromark("#\tx\t#\t"), + to_html("#\tx\t#\t"), "

x

", "should support tabs around ATX heading sequences" ); assert_eq!( - micromark("#\t\tx\t\t#\t\t"), + to_html("#\t\tx\t\t#\t\t"), "

x

", "should support arbitrary tabs around ATX heading sequences" ); assert_eq!( - micromark("```\tx\ty\t\n```\t"), + to_html("```\tx\ty\t\n```\t"), "
", "should support tabs around fenced code fences, info, and meta" ); assert_eq!( - micromark("```\t\tx\t\ty\t\t\n```\t\t"), + to_html("```\t\tx\t\ty\t\t\n```\t\t"), "
", "should support arbitrary tabs around fenced code fences, info, and meta" ); assert_eq!( - micromark("```x\n\t```"), + to_html("```x\n\t```"), "
\t```\n
\n", "should not support tabs before fenced code closing fences" ); assert_eq!( - micromark_with_options("", danger)?, + to_html_with_options("", danger)?, "", "should support tabs in HTML (if whitespace is allowed)" ); assert_eq!( - micromark("*\t*\t*\t"), + to_html("*\t*\t*\t"), "
", "should support tabs in thematic breaks" ); assert_eq!( - micromark("*\t\t*\t\t*\t\t"), + to_html("*\t\t*\t\t*\t\t"), "
", "should support arbitrary tabs in thematic breaks" ); @@ -139,67 +139,67 @@ fn tabs_flow() -> Result<(), String> { #[test] fn tabs_text() { assert_eq!( - micromark(""), + to_html(""), "

<http:\t>

", "should not support a tab to start an autolink w/ protocol’s rest" ); assert_eq!( - micromark(""), + to_html(""), "

<http:x\t>

", "should not support a tab in an autolink w/ protocol’s rest" ); assert_eq!( - micromark(""), + to_html(""), "

<example\t@x.com>

", "should not support a tab in an email autolink’s local part" ); assert_eq!( - micromark(""), + to_html(""), "

<example@x\ty.com>

", "should not support a tab in an email autolink’s label" ); assert_eq!( - micromark("\\\tx"), + to_html("\\\tx"), "

\\\tx

", "should not support character escaped tab" ); assert_eq!( - micromark(" "), + to_html(" "), "

\t

", "should support character reference resolving to a tab" ); assert_eq!( - micromark("`\tx`"), + to_html("`\tx`"), "

\tx

", "should support a tab starting code" ); assert_eq!( - micromark("`x\t`"), + to_html("`x\t`"), "

x\t

", "should support a tab ending code" ); assert_eq!( - micromark("`\tx\t`"), + to_html("`\tx\t`"), "

\tx\t

", "should support tabs around code" ); assert_eq!( - micromark("`\tx `"), + to_html("`\tx `"), "

\tx

", "should support a tab starting, and a space ending, code" ); assert_eq!( - micromark("` x\t`"), + to_html("` x\t`"), "

x\t

", "should support a space starting, and a tab ending, code" ); @@ -208,50 +208,50 @@ fn tabs_text() { // However, that should be a bug there: makes more sense to remove it like // trailing spaces. assert_eq!( - micromark("x\t\ny"), + to_html("x\t\ny"), "

x\ny

", "should support a trailing tab at a line ending in a paragraph" ); assert_eq!( - micromark("x\n\ty"), + to_html("x\n\ty"), "

x\ny

", "should support an initial tab after a line ending in a paragraph" ); assert_eq!( - micromark("x[\ty](z)"), + to_html("x[\ty](z)"), "

x\ty

", "should support an initial tab in a link label" ); assert_eq!( - micromark("x[y\t](z)"), + to_html("x[y\t](z)"), "

xy\t

", "should support a final tab in a link label" ); assert_eq!( - micromark("[x\ty](z)"), + to_html("[x\ty](z)"), "

x\ty

", "should support a tab in a link label" ); // Note: CM.js bug, see: assert_eq!( - micromark("[x](\ty)"), + to_html("[x](\ty)"), "

x

", "should support a tab starting a link resource" ); assert_eq!( - micromark("[x](y\t)"), + to_html("[x](y\t)"), "

x

", "should support a tab ending a link resource" ); assert_eq!( - micromark("[x](y\t\"z\")"), + to_html("[x](y\t\"z\")"), "

x

", "should support a tab between a link destination and title" ); @@ -260,31 +260,31 @@ fn tabs_text() { #[test] fn tabs_virtual_spaces() { assert_eq!( - micromark("```\n\tx"), + to_html("```\n\tx"), "
\tx\n
\n", "should support a tab in fenced code" ); assert_eq!( - micromark(" ```\n\tx"), + to_html(" ```\n\tx"), "
   x\n
\n", "should strip 1 space from an initial tab in fenced code if the opening fence is indented as such" ); assert_eq!( - micromark(" ```\n\tx"), + to_html(" ```\n\tx"), "
  x\n
\n", "should strip 2 spaces from an initial tab in fenced code if the opening fence is indented as such" ); assert_eq!( - micromark(" ```\n\tx"), + to_html(" ```\n\tx"), "
 x\n
\n", "should strip 3 spaces from an initial tab in fenced code if the opening fence is indented as such" ); assert_eq!( - micromark("-\ta\n\n\tb"), + to_html("-\ta\n\n\tb"), "
    \n
  • \n

    a

    \n

    \tb

    \n
  • \n
", // To do: CM.js does not output the tab before `b`. See if that makes sense? // "
    \n
  • \n

    a

    \n

    b

    \n
  • \n
", -- cgit