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/code_indented.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/code_indented.rs') diff --git a/tests/code_indented.rs b/tests/code_indented.rs index cd27953..29d8909 100644 --- a/tests/code_indented.rs +++ b/tests/code_indented.rs @@ -3,7 +3,7 @@ use micromark::{micromark, micromark_with_options, Constructs, Options}; use pretty_assertions::assert_eq; #[test] -fn code_indented() { +fn code_indented() -> Result<(), String> { assert_eq!( micromark(" a simple\n indented code block"), "
a simple\n  indented code block\n
", @@ -127,37 +127,37 @@ fn code_indented() { }; assert_eq!( - micromark_with_options(" a", &off), + micromark_with_options(" a", &off)?, "

a

", "should support turning off code (indented, 1)" ); assert_eq!( - micromark_with_options("> a\n b", &off), + micromark_with_options("> a\n b", &off)?, "
\n

a\nb

\n
", "should support turning off code (indented, 2)" ); assert_eq!( - micromark_with_options("- a\n b", &off), + micromark_with_options("- a\n b", &off)?, "", "should support turning off code (indented, 3)" ); assert_eq!( - micromark_with_options("- a\n - b", &off), + micromark_with_options("- a\n - b", &off)?, "", "should support turning off code (indented, 4)" ); assert_eq!( - micromark_with_options("- a\n - b", &off), + micromark_with_options("- a\n - b", &off)?, "", "should support turning off code (indented, 5)" ); assert_eq!( - micromark_with_options("```\na\n ```", &off), + micromark_with_options("```\na\n ```", &off)?, "
a\n
", "should support turning off code (indented, 6)" ); @@ -169,20 +169,22 @@ fn code_indented() { allow_dangerous_html: true, ..off.clone() } - ), + )?, "

a

", "should support turning off code (indented, 7)" ); assert_eq!( - micromark_with_options("- Foo\n---", &off), + micromark_with_options("- Foo\n---", &off)?, "\n
", "should support turning off code (indented, 8)" ); assert_eq!( - micromark_with_options("- Foo\n ---", &off), + micromark_with_options("- Foo\n ---", &off)?, "", "should support turning off code (indented, 9)" ); + + Ok(()) } -- cgit