parser: test nested list

This commit is contained in:
Noah Hellman 2023-01-22 12:39:44 +01:00
parent 70d29c65e4
commit 845c56fd0b

View file

@ -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!(