Update tests to compile again.
This commit is contained in:
@@ -69,22 +69,21 @@ fn comment_line<'r, 's>(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::parser::parser_context::ContextElement;
|
||||
use crate::parser::parser_context::ContextTree;
|
||||
use crate::parser::parser_with_context::parser_with_context;
|
||||
|
||||
#[test]
|
||||
fn require_space_after_hash() {
|
||||
let input = "# Comment line
|
||||
let input = OrgSource::new(
|
||||
"# Comment line
|
||||
#not a comment
|
||||
# Comment again";
|
||||
# Comment again",
|
||||
);
|
||||
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
||||
let document_context =
|
||||
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
|
||||
let comment_matcher = parser_with_context!(comment)(&document_context);
|
||||
let comment_matcher = parser_with_context!(comment)(&initial_context);
|
||||
let (remaining, first_comment) = comment_matcher(input).expect("Parse first comment");
|
||||
assert_eq!(
|
||||
remaining,
|
||||
Into::<&str>::into(remaining),
|
||||
r#"#not a comment
|
||||
# Comment again"#
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user