Diffstat (limited to 'tests/protocol_visitor_sequence.rs')
| -rw-r--r-- | tests/protocol_visitor_sequence.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/protocol_visitor_sequence.rs b/tests/protocol_visitor_sequence.rs index 1b74c3f..8657daf 100644 --- a/tests/protocol_visitor_sequence.rs +++ b/tests/protocol_visitor_sequence.rs @@ -1,11 +1,9 @@ use std::any::TypeId; -use common::protocol::sequence::{ - MockSequenceScopeVisitor, MockSequenceVisitor, SequenceScopeFactory, -}; +use common::protocol::sequence::{MockSequenceScope, MockSequenceVisitor, SequenceScopeFactory}; use treaty::{ any::{OwnedStatic, TypeNameId}, - effect::Blocking, + effect::{Blocking, ReadyValue}, protocol::{ visitor::{Sequence, SequenceProto, ValueProto, VisitResult}, DynVisitor, @@ -25,7 +23,7 @@ fn sequence_has_scope_with_size_hint_and_next() { mock.expect_visit().once().return_const( (|(), scope| { // Get the size hint from the sequence scope. - assert_eq!(scope.size_hint().into_inner(), (1, Some(1))); + assert_eq!(scope.size_hint().value(), (1, Some(1))); let mut visitor = MockBuilder::<(), (), ()>::new(); @@ -33,7 +31,7 @@ fn sequence_has_scope_with_size_hint_and_next() { visitor.expect_traits().once().return_const(None); // Get the next item in the sequence from the walker. - scope.next(DynVisitor(&mut visitor)); + assert_eq!(scope.next(DynVisitor(&mut visitor)).value(), Flow::Done); // We are done. VisitResult::Control(Flow::Done) @@ -43,7 +41,7 @@ fn sequence_has_scope_with_size_hint_and_next() { // Everything goes throw the sequence protocol trait. let visitor: &mut dyn Sequence<Blocking> = &mut mock; - let mut scope = MockSequenceScopeVisitor::<Blocking>::new(); + let mut scope = MockSequenceScope::<Blocking>::new(); // Expect a size hint to be asked for. scope.expect_size_hint().once().return_const((1, Some(1))); @@ -61,7 +59,7 @@ fn sequence_has_scope_with_size_hint_and_next() { // Visit a sequence. assert!(matches!( - visitor.visit(&mut scope).into_inner(), + visitor.visit(&mut scope).value(), VisitResult::Control(Flow::Done) )); } |