aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc_line_ending.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-07 15:53:06 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-07 15:53:06 +0200
commit1d92666865b35341e076efbefddf6e73b5e1542e (patch)
tree11c05985ec7679f73473e7ea2c769465698e2f08 /tests/misc_line_ending.rs
parente6018e52ee6ad9a8f8a0672b75bf515faf74af1f (diff)
downloadmarkdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.gz
markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.bz2
markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.zip
Add support for recoverable syntax errors
Diffstat (limited to '')
-rw-r--r--tests/misc_line_ending.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/misc_line_ending.rs b/tests/misc_line_ending.rs
index d8334d8..6713b32 100644
--- a/tests/misc_line_ending.rs
+++ b/tests/misc_line_ending.rs
@@ -3,7 +3,7 @@ use micromark::{micromark, micromark_with_options, Options};
use pretty_assertions::assert_eq;
#[test]
-fn line_ending() {
+fn line_ending() -> Result<(), String> {
let danger = &Options {
allow_dangerous_html: true,
allow_dangerous_protocol: true,
@@ -131,56 +131,58 @@ fn line_ending() {
);
assert_eq!(
- micromark_with_options("<div\n", danger),
+ micromark_with_options("<div\n", danger)?,
"<div\n",
"should support a line feed after html"
);
assert_eq!(
- micromark_with_options("<div\r", danger),
+ micromark_with_options("<div\r", danger)?,
"<div\r",
"should support a carriage return after html"
);
assert_eq!(
- micromark_with_options("<div\r\n", danger),
+ micromark_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),
+ micromark_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),
+ micromark_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),
+ micromark_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),
+ micromark_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),
+ micromark_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),
+ micromark_with_options("<div>\r\nx", danger)?,
"<div>\r\nx",
"should support a non-blank line w/ carriage return + line feed in html"
);
+
+ Ok(())
}