From 5403261e8213f68633a09fc3e9bc2e6e2cd777b2 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 18 Jul 2022 16:31:14 +0200 Subject: Add support for turning off constructs --- tests/commonmark.rs | 4576 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 3266 insertions(+), 1310 deletions(-) (limited to 'tests/commonmark.rs') diff --git a/tests/commonmark.rs b/tests/commonmark.rs index 59908a2..95871a4 100644 --- a/tests/commonmark.rs +++ b/tests/commonmark.rs @@ -6,18 +6,21 @@ extern crate micromark; use micromark::{micromark_with_options, Options}; -const DANGER: &Options = &Options { - allow_dangerous_html: true, - allow_dangerous_protocol: true, - default_line_ending: None, -}; - #[rustfmt::skip] #[test] fn commonmark() { + let danger = Options { + allow_dangerous_html: true, + allow_dangerous_protocol: true, + ..Options::default() + }; + assert_eq!( - micromark_with_options(r###" foo baz bim -"###, DANGER), + micromark_with_options( + r###" foo baz bim +"###, + &danger + ), r###"
foo	baz		bim
 
"###, @@ -25,8 +28,11 @@ fn commonmark() { ); assert_eq!( - micromark_with_options(r###" foo baz bim -"###, DANGER), + micromark_with_options( + r###" foo baz bim +"###, + &danger + ), r###"
foo	baz		bim
 
"###, @@ -34,9 +40,12 @@ fn commonmark() { ); assert_eq!( - micromark_with_options(r###" a a + micromark_with_options( + r###" a a ὐ a -"###, DANGER), +"###, + &danger + ), r###"
a	a
 ὐ	a
 
@@ -45,10 +54,13 @@ fn commonmark() { ); assert_eq!( - micromark_with_options(r###" - foo + micromark_with_options( + r###" - foo bar -"###, DANGER), +"###, + &danger + ), r###"