diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-07 15:53:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-07 15:53:06 +0200 |
commit | 1d92666865b35341e076efbefddf6e73b5e1542e (patch) | |
tree | 11c05985ec7679f73473e7ea2c769465698e2f08 /tests/code_indented.rs | |
parent | e6018e52ee6ad9a8f8a0672b75bf515faf74af1f (diff) | |
download | markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.gz markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.bz2 markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.zip |
Add support for recoverable syntax errors
Diffstat (limited to '')
-rw-r--r-- | tests/code_indented.rs | 22 |
1 files changed, 12 insertions, 10 deletions
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"), "<pre><code>a simple\n indented code block\n</code></pre>", @@ -127,37 +127,37 @@ fn code_indented() { }; assert_eq!( - micromark_with_options(" a", &off), + micromark_with_options(" a", &off)?, "<p>a</p>", "should support turning off code (indented, 1)" ); assert_eq!( - micromark_with_options("> a\n b", &off), + micromark_with_options("> a\n b", &off)?, "<blockquote>\n<p>a\nb</p>\n</blockquote>", "should support turning off code (indented, 2)" ); assert_eq!( - micromark_with_options("- a\n b", &off), + micromark_with_options("- a\n b", &off)?, "<ul>\n<li>a\nb</li>\n</ul>", "should support turning off code (indented, 3)" ); assert_eq!( - micromark_with_options("- a\n - b", &off), + micromark_with_options("- a\n - b", &off)?, "<ul>\n<li>a\n<ul>\n<li>b</li>\n</ul>\n</li>\n</ul>", "should support turning off code (indented, 4)" ); assert_eq!( - micromark_with_options("- a\n - b", &off), + micromark_with_options("- a\n - b", &off)?, "<ul>\n<li>a\n<ul>\n<li>b</li>\n</ul>\n</li>\n</ul>", "should support turning off code (indented, 5)" ); assert_eq!( - micromark_with_options("```\na\n ```", &off), + micromark_with_options("```\na\n ```", &off)?, "<pre><code>a\n</code></pre>", "should support turning off code (indented, 6)" ); @@ -169,20 +169,22 @@ fn code_indented() { allow_dangerous_html: true, ..off.clone() } - ), + )?, "<p>a <?\n?></p>", "should support turning off code (indented, 7)" ); assert_eq!( - micromark_with_options("- Foo\n---", &off), + micromark_with_options("- Foo\n---", &off)?, "<ul>\n<li>Foo</li>\n</ul>\n<hr />", "should support turning off code (indented, 8)" ); assert_eq!( - micromark_with_options("- Foo\n ---", &off), + micromark_with_options("- Foo\n ---", &off)?, "<ul>\n<li>\n<h2>Foo</h2>\n</li>\n</ul>", "should support turning off code (indented, 9)" ); + + Ok(()) } |