aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hard_break_trailing.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 10:40:01 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 10:40:01 +0200
commitec2d1bfb4232178fb3a6cba36f138bc6efbbf34a (patch)
tree2da4be3be22c2324c48cb17133b3f4b26b9139d2 /tests/hard_break_trailing.rs
parent861af95c119721e814460fa7dc32bd3d74b38484 (diff)
downloadmarkdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.gz
markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.bz2
markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.zip
Rename crate to `markdown`
Diffstat (limited to 'tests/hard_break_trailing.rs')
-rw-r--r--tests/hard_break_trailing.rs44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/hard_break_trailing.rs b/tests/hard_break_trailing.rs
index c724c85..78f5550 100644
--- a/tests/hard_break_trailing.rs
+++ b/tests/hard_break_trailing.rs
@@ -1,7 +1,7 @@
-extern crate micromark;
-use micromark::{
+extern crate markdown;
+use markdown::{
mdast::{Break, 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,109 +10,109 @@ use pretty_assertions::assert_eq;
#[test]
fn hard_break_trailing() -> Result<(), String> {
assert_eq!(
- micromark("foo \nbaz"),
+ to_html("foo \nbaz"),
"<p>foo<br />\nbaz</p>",
"should support two trailing spaces to form a hard break"
);
assert_eq!(
- micromark("foo \nbaz"),
+ to_html("foo \nbaz"),
"<p>foo<br />\nbaz</p>",
"should support multiple trailing spaces"
);
assert_eq!(
- micromark("foo \n bar"),
+ to_html("foo \n bar"),
"<p>foo<br />\nbar</p>",
"should support leading spaces after a trailing hard break"
);
assert_eq!(
- micromark("*foo \nbar*"),
+ to_html("*foo \nbar*"),
"<p><em>foo<br />\nbar</em></p>",
"should support trailing hard breaks in emphasis"
);
assert_eq!(
- micromark("`code \ntext`"),
+ to_html("`code \ntext`"),
"<p><code>code text</code></p>",
"should not support trailing hard breaks in code"
);
assert_eq!(
- micromark("foo "),
+ to_html("foo "),
"<p>foo</p>",
"should not support trailing hard breaks at the end of a paragraph"
);
assert_eq!(
- micromark("### foo "),
+ to_html("### foo "),
"<h3>foo</h3>",
"should not support trailing hard breaks at the end of a heading"
);
assert_eq!(
- micromark("aaa \t\nbb"),
+ to_html("aaa \t\nbb"),
"<p>aaa\nbb</p>",
"should support a mixed line suffix (1)"
);
assert_eq!(
- micromark("aaa\t \nbb"),
+ to_html("aaa\t \nbb"),
"<p>aaa\nbb</p>",
"should support a mixed line suffix (2)"
);
assert_eq!(
- micromark("aaa \t \nbb"),
+ to_html("aaa \t \nbb"),
"<p>aaa\nbb</p>",
"should support a mixed line suffix (3)"
);
assert_eq!(
- micromark("aaa\0 \nbb"),
+ to_html("aaa\0 \nbb"),
"<p>aaa�<br />\nbb</p>",
"should support a hard break after a replacement character"
);
assert_eq!(
- micromark("aaa\0\t\nbb"),
+ to_html("aaa\0\t\nbb"),
"<p>aaa�\nbb</p>",
"should support a line suffix after a replacement character"
);
assert_eq!(
- micromark("*a* \nbb"),
+ to_html("*a* \nbb"),
"<p><em>a</em><br />\nbb</p>",
"should support a hard break after a span"
);
assert_eq!(
- micromark("*a*\t\nbb"),
+ to_html("*a*\t\nbb"),
"<p><em>a</em>\nbb</p>",
"should support a line suffix after a span"
);
assert_eq!(
- micromark("*a* \t\nbb"),
+ to_html("*a* \t\nbb"),
"<p><em>a</em>\nbb</p>",
"should support a mixed line suffix after a span (1)"
);
assert_eq!(
- micromark("*a*\t \nbb"),
+ to_html("*a*\t \nbb"),
"<p><em>a</em>\nbb</p>",
"should support a mixed line suffix after a span (2)"
);
assert_eq!(
- micromark("*a* \t \nbb"),
+ to_html("*a* \t \nbb"),
"<p><em>a</em>\nbb</p>",
"should support a mixed line suffix after a span (3)"
);
assert_eq!(
- micromark_with_options(
+ to_html_with_options(
"a \nb",
&Options {
parse: ParseOptions {
@@ -130,7 +130,7 @@ fn hard_break_trailing() -> Result<(), String> {
);
assert_eq!(
- micromark_to_mdast("a \nb.", &ParseOptions::default())?,
+ to_mdast("a \nb.", &ParseOptions::default())?,
Node::Root(Root {
children: vec![Node::Paragraph(Paragraph {
children: vec![