Add with_additional_fail_matcher.
This commit is contained in:
		
							parent
							
								
									a55b7c42fd
								
							
						
					
					
						commit
						15dedc8ee9
					
				| @ -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() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander