Update tests to compile again.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user