From 845c56fd0b55c80aed81f701e57fdbf6eadd020b Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Sun, 22 Jan 2023 12:39:44 +0100 Subject: [PATCH] parser: test nested list --- src/lib.rs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 480fbcf..271aa1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1052,6 +1052,50 @@ mod test { ); } + #[test] + fn list_item_unordered_nest() { + test_parse!( + concat!( + "- a\n", // + "\n", // + " - aa\n", // + ), + Start( + List { + kind: ListKind::Unordered, + tight: false, + }, + Attributes::new(), + ), + Start(ListItem, Attributes::new()), + Start(Paragraph, Attributes::new()), + Str("a".into()), + End(Paragraph), + Atom(Blankline), + Start( + List { + kind: ListKind::Unordered, + tight: true, + }, + Attributes::new(), + ), + Start(ListItem, Attributes::new()), + Start(Paragraph, Attributes::new()), + Str("aa".into()), + End(Paragraph), + End(ListItem), + End(List { + kind: ListKind::Unordered, + tight: true, + }), + End(ListItem), + End(List { + kind: ListKind::Unordered, + tight: true, + }), + ); + } + #[test] fn list_item_ordered_decimal() { test_parse!(