diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 10:40:01 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 10:40:01 +0200 |
commit | ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a (patch) | |
tree | 2da4be3be22c2324c48cb17133b3f4b26b9139d2 /tests/misc_line_ending.rs | |
parent | 861af95c119721e814460fa7dc32bd3d74b38484 (diff) | |
download | markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.gz markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.bz2 markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.zip |
Rename crate to `markdown`
Diffstat (limited to '')
-rw-r--r-- | tests/misc_line_ending.rs | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/tests/misc_line_ending.rs b/tests/misc_line_ending.rs index 90f9df0..52b84d8 100644 --- a/tests/misc_line_ending.rs +++ b/tests/misc_line_ending.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] @@ -13,176 +13,176 @@ fn line_ending() -> Result<(), String> { ..Options::default() }; - assert_eq!(micromark("\n"), "", "should support just a line feed"); + assert_eq!(to_html("\n"), "", "should support just a line feed"); - assert_eq!(micromark("\r"), "", "should support just a carriage return"); + assert_eq!(to_html("\r"), "", "should support just a carriage return"); assert_eq!( - micromark("\r\n"), + to_html("\r\n"), "", "should support just a carriage return + line feed" ); - assert_eq!(micromark("\n\n"), "", "should support just two line feeds"); + assert_eq!(to_html("\n\n"), "", "should support just two line feeds"); assert_eq!( - micromark("\r\r"), + to_html("\r\r"), "", "should support just two carriage return" ); assert_eq!( - micromark("\r\n\r\n"), + to_html("\r\n\r\n"), "", "should support just two carriage return + line feeds" ); assert_eq!( - micromark("a\nb"), + to_html("a\nb"), "<p>a\nb</p>", "should support a line feed for a line ending inside a paragraph" ); assert_eq!( - micromark("a\rb"), + to_html("a\rb"), "<p>a\rb</p>", "should support a carriage return for a line ending inside a paragraph" ); assert_eq!( - micromark("a\r\nb"), + to_html("a\r\nb"), "<p>a\r\nb</p>", "should support a carriage return + line feed for a line ending inside a paragraph" ); assert_eq!( - micromark("\ta\n\tb"), + to_html("\ta\n\tb"), "<pre><code>a\nb\n</code></pre>", "should support a line feed in indented code (and prefer it)" ); assert_eq!( - micromark("\ta\r\tb"), + to_html("\ta\r\tb"), "<pre><code>a\rb\r</code></pre>", "should support a carriage return in indented code (and prefer it)" ); assert_eq!( - micromark("\ta\r\n\tb"), + to_html("\ta\r\n\tb"), "<pre><code>a\r\nb\r\n</code></pre>", "should support a carriage return + line feed in indented code (and prefer it)" ); assert_eq!( - micromark("***\n### Heading"), + to_html("***\n### Heading"), "<hr />\n<h3>Heading</h3>", "should support a line feed between flow" ); assert_eq!( - micromark("***\r### Heading"), + to_html("***\r### Heading"), "<hr />\r<h3>Heading</h3>", "should support a carriage return between flow" ); assert_eq!( - micromark("***\r\n### Heading"), + to_html("***\r\n### Heading"), "<hr />\r\n<h3>Heading</h3>", "should support a carriage return + line feed between flow" ); assert_eq!( - micromark("***\n\n\n### Heading\n"), + to_html("***\n\n\n### Heading\n"), "<hr />\n<h3>Heading</h3>\n", "should support several line feeds between flow" ); assert_eq!( - micromark("***\r\r\r### Heading\r"), + to_html("***\r\r\r### Heading\r"), "<hr />\r<h3>Heading</h3>\r", "should support several carriage returns between flow" ); assert_eq!( - micromark("***\r\n\r\n\r\n### Heading\r\n"), + to_html("***\r\n\r\n\r\n### Heading\r\n"), "<hr />\r\n<h3>Heading</h3>\r\n", "should support several carriage return + line feeds between flow" ); assert_eq!( - micromark("```x\n\n\ny\n\n\n```\n\n\n"), + to_html("```x\n\n\ny\n\n\n```\n\n\n"), "<pre><code class=\"language-x\">\n\ny\n\n\n</code></pre>\n", "should support several line feeds in fenced code" ); assert_eq!( - micromark("```x\r\r\ry\r\r\r```\r\r\r"), + to_html("```x\r\r\ry\r\r\r```\r\r\r"), "<pre><code class=\"language-x\">\r\ry\r\r\r</code></pre>\r", "should support several carriage returns in fenced code" ); assert_eq!( - micromark("```x\r\n\r\n\r\ny\r\n\r\n\r\n```\r\n\r\n\r\n"), + to_html("```x\r\n\r\n\r\ny\r\n\r\n\r\n```\r\n\r\n\r\n"), "<pre><code class=\"language-x\">\r\n\r\ny\r\n\r\n\r\n</code></pre>\r\n", "should support several carriage return + line feeds in fenced code" ); assert_eq!( - micromark("A\r\nB\r\n-\r\nC"), + to_html("A\r\nB\r\n-\r\nC"), "<h2>A\r\nB</h2>\r\n<p>C</p>", "should support a carriage return + line feed in content" ); assert_eq!( - micromark_with_options("<div\n", danger)?, + to_html_with_options("<div\n", danger)?, "<div\n", "should support a line feed after html" ); assert_eq!( - micromark_with_options("<div\r", danger)?, + to_html_with_options("<div\r", danger)?, "<div\r", "should support a carriage return after html" ); assert_eq!( - micromark_with_options("<div\r\n", danger)?, + to_html_with_options("<div\r\n", danger)?, "<div\r\n", "should support a carriage return + line feed after html" ); assert_eq!( - micromark_with_options("<div>\n\nx", danger)?, + to_html_with_options("<div>\n\nx", danger)?, "<div>\n<p>x</p>", "should support a blank line w/ line feeds after html" ); assert_eq!( - micromark_with_options("<div>\r\rx", danger)?, + to_html_with_options("<div>\r\rx", danger)?, "<div>\r<p>x</p>", "should support a blank line w/ carriage returns after html" ); assert_eq!( - micromark_with_options("<div>\r\n\r\nx", danger)?, + to_html_with_options("<div>\r\n\r\nx", danger)?, "<div>\r\n<p>x</p>", "should support a blank line w/ carriage return + line feeds after html" ); assert_eq!( - micromark_with_options("<div>\nx", danger)?, + to_html_with_options("<div>\nx", danger)?, "<div>\nx", "should support a non-blank line w/ line feed in html" ); assert_eq!( - micromark_with_options("<div>\rx", danger)?, + to_html_with_options("<div>\rx", danger)?, "<div>\rx", "should support a non-blank line w/ carriage return in html" ); assert_eq!( - micromark_with_options("<div>\r\nx", danger)?, + to_html_with_options("<div>\r\nx", danger)?, "<div>\r\nx", "should support a non-blank line w/ carriage return + line feed in html" ); |