aboutsummaryrefslogtreecommitdiffstats
path: root/tests/character_escape.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/character_escape.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/character_escape.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/character_escape.rs b/tests/character_escape.rs
index 2ecaa5f..e76e3e9 100644
--- a/tests/character_escape.rs
+++ b/tests/character_escape.rs
@@ -3,7 +3,7 @@ use micromark::{micromark, micromark_with_options, Constructs, Options};
use pretty_assertions::assert_eq;
#[test]
-fn character_escape() {
+fn character_escape() -> Result<(), String> {
let danger = Options {
allow_dangerous_html: true,
allow_dangerous_protocol: true,
@@ -12,8 +12,7 @@ fn character_escape() {
assert_eq!(
micromark(
- "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~"
- ),
+ "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~"),
"<p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\\]^_`{|}~</p>",
"should support escaped ascii punctuation"
);
@@ -26,8 +25,7 @@ fn character_escape() {
assert_eq!(
micromark(
- "\\*not emphasized*\n\\<br/> not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\&ouml; not a character entity"
- ),
+ "\\*not emphasized*\n\\<br/> not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\&ouml; not a character entity"),
"<p>*not emphasized*\n&lt;br/&gt; not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url &quot;not a reference&quot;\n&amp;ouml; not a character entity</p>",
"should escape other constructs"
);
@@ -57,7 +55,7 @@ fn character_escape() {
);
assert_eq!(
- micromark_with_options("<a href=\"/bar\\/)\">", &danger),
+ micromark_with_options("<a href=\"/bar\\/)\">", &danger)?,
"<a href=\"/bar\\/)\">",
"should not escape in flow html"
);
@@ -90,8 +88,10 @@ fn character_escape() {
},
..Options::default()
}
- ),
+ )?,
"<p>\\&gt; a</p>",
"should support turning off character escapes"
);
+
+ Ok(())
}