Update tests to compile again.

This commit is contained in:
Tom Alexander
2023-08-24 17:15:24 -04:00
parent 3348807a05
commit e84e2b5147
8 changed files with 71 additions and 100 deletions

View File

@@ -69,20 +69,17 @@ mod tests {
use nom::combinator::map;
use super::*;
use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ContextTree;
use crate::parser::parser_with_context::parser_with_context;
use crate::parser::source::Source;
#[test]
fn plain_text_simple() {
let input = "foobarbaz";
let input = OrgSource::new("foobarbaz");
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let document_context =
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
let plain_text_matcher = parser_with_context!(plain_text)(&document_context);
let plain_text_matcher = parser_with_context!(plain_text)(&initial_context);
let (remaining, result) = map(plain_text_matcher, Object::PlainText)(input).unwrap();
assert_eq!(remaining, "");
assert_eq!(result.get_source(), input);
assert_eq!(Into::<&str>::into(remaining), "");
assert_eq!(result.get_source(), Into::<&str>::into(input));
}
}