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/gfm_task_list_item.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 'tests/gfm_task_list_item.rs')
-rw-r--r-- | tests/gfm_task_list_item.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/gfm_task_list_item.rs b/tests/gfm_task_list_item.rs index 66b646f..b824730 100644 --- a/tests/gfm_task_list_item.rs +++ b/tests/gfm_task_list_item.rs @@ -3,7 +3,7 @@ use micromark::{micromark, micromark_with_options, Constructs, Options}; use pretty_assertions::assert_eq; #[test] -fn gfm_task_list_item() { +fn gfm_task_list_item() -> Result<(), String> { let gfm = Options { constructs: Constructs::gfm(), ..Options::default() @@ -16,25 +16,25 @@ fn gfm_task_list_item() { ); assert_eq!( - micromark_with_options("* [x] y.", &gfm), + micromark_with_options("* [x] y.", &gfm)?, "<ul>\n<li><input type=\"checkbox\" disabled=\"\" checked=\"\" /> y.</li>\n</ul>", "should support task list item checks" ); assert_eq!( - micromark_with_options("* [ ] z.", &gfm), + micromark_with_options("* [ ] z.", &gfm)?, "<ul>\n<li><input type=\"checkbox\" disabled=\"\" /> z.</li>\n</ul>", "should support unchecked task list item checks" ); assert_eq!( - micromark_with_options("*\n [x]", &gfm), + micromark_with_options("*\n [x]", &gfm)?, "<ul>\n<li>[x]</li>\n</ul>", "should not support laziness (1)" ); assert_eq!( - micromark_with_options("*\n[x]", &gfm), + micromark_with_options("*\n[x]", &gfm)?, "<ul>\n<li></li>\n</ul>\n<p>[x]</p>", "should not support laziness (2)" ); @@ -122,7 +122,7 @@ EOL after: .replace('␠', " ") .replace('␉', "\t"), &gfm - ), + )?, r###"<ul> <li><input type="checkbox" disabled="" /> foo</li> <li><input type="checkbox" disabled="" checked="" /> bar</li> @@ -239,4 +239,6 @@ Text.</li> "###, "should handle things like GitHub" ); + + Ok(()) } |