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/character_reference.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/character_reference.rs') diff --git a/tests/character_reference.rs b/tests/character_reference.rs index c388514..a08c3f9 100644 --- a/tests/character_reference.rs +++ b/tests/character_reference.rs @@ -3,11 +3,10 @@ use micromark::{micromark, micromark_with_options, Constructs, Options}; use pretty_assertions::assert_eq; #[test] -fn character_reference() { +fn character_reference() -> Result<(), String> { assert_eq!( micromark( - "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸" - ), + "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸"), "

\u{a0} & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

", "should support named character references" ); @@ -26,8 +25,7 @@ fn character_reference() { assert_eq!( micromark( - "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;" - ), + "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"), "

&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

", "should not support other things that look like character references" ); @@ -51,7 +49,7 @@ fn character_reference() { allow_dangerous_html: true, ..Options::default() } - ), + )?, "", "should not care about character references in html" ); @@ -199,8 +197,10 @@ fn character_reference() { }, ..Options::default() } - ), + )?, "

&amp;

", "should support turning off character references" ); + + Ok(()) } -- cgit