Add with_additional_fail_matcher.

This commit is contained in:
Tom Alexander
2022-11-27 00:12:33 -05:00
parent a55b7c42fd
commit 15dedc8ee9

View File

@@ -46,11 +46,11 @@ pub trait ContextElement {
fn get_fail_matcher<'r>(&'r self) -> ChainBehavior<'r>;
}
struct FailMatcherNode<'r> {
pub struct FailMatcherNode<'r> {
fail_matcher: ChainBehavior<'r>,
}
struct PreviousElementNode<'r> {
pub struct PreviousElementNode<'r> {
dummy: &'r str,
}
@@ -101,6 +101,15 @@ where
head: Some(new_node),
}
}
pub fn with_additional_fail_matcher(
&'r self,
fail_matcher: &'r Matcher,
) -> ContextTree<'r, FailMatcherNode> {
self.with_additional_node(FailMatcherNode {
fail_matcher: ChainBehavior::AndParent(Some(fail_matcher))
})
}
}
fn test_context() {