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/html_flow.rs | 328 ++++++++++++++++++++++++++++------------------------- 1 file changed, 172 insertions(+), 156 deletions(-) (limited to 'tests/html_flow.rs') diff --git a/tests/html_flow.rs b/tests/html_flow.rs index 7013657..c411036 100644 --- a/tests/html_flow.rs +++ b/tests/html_flow.rs @@ -3,7 +3,7 @@ use micromark::{micromark, micromark_with_options, Constructs, Options}; use pretty_assertions::assert_eq; #[test] -fn html_flow() { +fn html_flow() -> Result<(), String> { let danger = Options { allow_dangerous_html: true, ..Options::default() @@ -16,7 +16,7 @@ fn html_flow() { ); assert_eq!( - micromark_with_options("", &danger), + micromark_with_options("", &danger)?, "", "should support a heading w/ rank 1" ); @@ -31,14 +31,16 @@ fn html_flow() { }, ..Options::default() } - ), + )?, "

<x>

", "should support turning off html (flow)" ); + + Ok(()) } #[test] -fn html_flow_1_raw() { +fn html_flow_1_raw() -> Result<(), String> { let danger = Options { allow_dangerous_html: true, ..Options::default() @@ -54,7 +56,7 @@ main = print $ parseTags tags okay", &danger - ), + )?, "

 import Text.HTML.TagSoup
 
@@ -74,7 +76,7 @@ document.getElementById(\"demo\").innerHTML = \"Hello JavaScript!\";
 
 okay",
             &danger
-        ),
+        )?,
         "1. *bar*", &danger),
+        micromark_with_options("1. *bar*", &danger)?,
         "1. *bar*",
         "should support raw tags w/ more data on ending line"
     );
 
     assert_eq!(
-        micromark_with_options("</script\nmore

", "should not support a raw closing tag" ); assert_eq!( - micromark_with_options("", &danger), + micromark_with_options("", &danger)?, "", "should support blank lines in raw" ); assert_eq!( - micromark_with_options(">