aboutsummaryrefslogtreecommitdiffstats
path: root/tests/link_resource.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/link_resource.rs')
-rw-r--r--tests/link_resource.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/link_resource.rs b/tests/link_resource.rs
index 31e4b81..7f48fb1 100644
--- a/tests/link_resource.rs
+++ b/tests/link_resource.rs
@@ -1,14 +1,14 @@
extern crate micromark;
use micromark::{micromark, micromark_with_options, Options};
-const DANGER: &Options = &Options {
- allow_dangerous_html: true,
- allow_dangerous_protocol: true,
- default_line_ending: None,
-};
-
#[test]
fn link_resource() {
+ let danger = Options {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..Options::default()
+ };
+
assert_eq!(
micromark("[link](/uri \"title\")"),
"<p><a href=\"/uri\" title=\"title\">link</a></p>",
@@ -52,7 +52,7 @@ fn link_resource() {
);
assert_eq!(
- micromark_with_options("[link](<foo\nbar>)", DANGER),
+ micromark_with_options("[link](<foo\nbar>)", &danger),
"<p>[link](<foo\nbar>)</p>",
"should not support links w/ line endings in enclosed destination"
);
@@ -70,7 +70,7 @@ fn link_resource() {
);
assert_eq!(
- micromark_with_options("[a](<b)c\n[a](<b)c>\n[a](<b>c)", DANGER),
+ micromark_with_options("[a](<b)c\n[a](<b)c>\n[a](<b>c)", &danger),
"<p>[a](&lt;b)c\n[a](&lt;b)c&gt;\n[a](<b>c)</p>",
"should not support links w/ unmatched enclosed destinations"
);
@@ -100,7 +100,7 @@ fn link_resource() {
);
assert_eq!(
- micromark_with_options("[link](foo\\)\\:)", DANGER),
+ micromark_with_options("[link](foo\\)\\:)", &danger),
"<p><a href=\"foo):\">link</a></p>",
"should support links w/ escapes in destinations"
);
@@ -274,7 +274,7 @@ fn link_resource() {
);
assert_eq!(
- micromark_with_options("[foo <bar attr=\"](baz)\">", DANGER),
+ micromark_with_options("[foo <bar attr=\"](baz)\">", &danger),
"<p>[foo <bar attr=\"](baz)\"></p>",
"should prefer HTML over links"
);
@@ -312,7 +312,7 @@ fn link_resource() {
);
assert_eq!(
- micromark_with_options("[a](<b>\"c\")", DANGER),
+ micromark_with_options("[a](<b>\"c\")", &danger),
"<p>[a](<b>&quot;c&quot;)</p>",
"should require whitespace between enclosed destination and title"
);