From 1d92666865b35341e076efbefddf6e73b5e1542e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 7 Sep 2022 15:53:06 +0200 Subject: Add support for recoverable syntax errors --- tests/misc_dangerous_protocol.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/misc_dangerous_protocol.rs') diff --git a/tests/misc_dangerous_protocol.rs b/tests/misc_dangerous_protocol.rs index 0c25eba..88058f2 100644 --- a/tests/misc_dangerous_protocol.rs +++ b/tests/misc_dangerous_protocol.rs @@ -3,7 +3,7 @@ use micromark::micromark; use pretty_assertions::assert_eq; #[test] -fn dangerous_protocol_autolink() { +fn dangerous_protocol_autolink() -> Result<(), String> { assert_eq!( micromark(""), "

javascript:alert(1)

", @@ -33,10 +33,12 @@ fn dangerous_protocol_autolink() { "

mailto:a

", "should allow `mailto:`" ); + + Ok(()) } #[test] -fn dangerous_protocol_image() { +fn dangerous_protocol_image() -> Result<(), String> { assert_eq!( micromark("![](javascript:alert(1))"), "

\"\"

", @@ -114,10 +116,12 @@ fn dangerous_protocol_image() { "

\"\"

", "should allow a colon in a path" ); + + Ok(()) } #[test] -fn dangerous_protocol_link() { +fn dangerous_protocol_link() -> Result<(), String> { assert_eq!( micromark("[](javascript:alert(1))"), "

", @@ -195,4 +199,6 @@ fn dangerous_protocol_link() { "

", "should allow a colon in a path" ); + + Ok(()) } -- cgit