Add a special case exit matcher for end of file.
This commit is contained in:
@@ -131,4 +131,16 @@ mod tests {
|
||||
assert_eq!(remaining, "");
|
||||
assert_eq!(result.source, "1.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plain_list_item_simple() {
|
||||
let input = "1. foo";
|
||||
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
||||
let document_context =
|
||||
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
|
||||
let plain_list_item_matcher = parser_with_context!(plain_list_item)(&document_context);
|
||||
let (remaining, result) = plain_list_item_matcher(input).unwrap();
|
||||
assert_eq!(remaining, "");
|
||||
assert_eq!(result.source, "1. foo");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user