Diffstat (limited to 'tests/protocol_visitor_sequence.rs')
| -rw-r--r-- | tests/protocol_visitor_sequence.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/protocol_visitor_sequence.rs b/tests/protocol_visitor_sequence.rs index ab4d694..49f6317 100644 --- a/tests/protocol_visitor_sequence.rs +++ b/tests/protocol_visitor_sequence.rs @@ -1,4 +1,5 @@ use std::any::TypeId; +use effectful::blocking::BlockingSpin; use common::protocol::sequence::{MockSequenceScope, MockSequenceVisitor}; use treaty::{ @@ -10,20 +11,20 @@ use treaty::{ Flow, }; -use crate::common::{builder::MockBuilder, Blocking}; +use crate::common::{builder::MockBuilder}; mod common; #[test] fn sequence_has_scope_with_size_hint_and_next() { - let mut mock = MockSequenceVisitor::<Blocking>::new(); + let mut mock = MockSequenceVisitor::<BlockingSpin>::new(); // Expect a visit with the sequence protocol. mock.expect_visit().once().returning(|scope| { // Get the size hint from the sequence scope. assert_eq!(scope.size_hint().into_value(), (1, Some(1))); - let mut visitor = MockBuilder::<(), (), (), Blocking>::new(); + let mut visitor = MockBuilder::<(), (), (), BlockingSpin>::new(); // Expect the walker to lookup a trait. visitor.expect_traits().once().return_const(None); @@ -39,9 +40,9 @@ 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 visitor: &mut dyn Sequence<BlockingSpin> = &mut mock; - let mut scope = MockSequenceScope::<Blocking>::new(); + let mut scope = MockSequenceScope::<BlockingSpin>::new(); // Expect a size hint to be asked for. scope.expect_size_hint().once().return_const((1, Some(1))); @@ -50,7 +51,7 @@ fn sequence_has_scope_with_size_hint_and_next() { scope.expect_next().once().returning(|visitor| { // Attempt to lookup a trait on the visitor. assert!(visitor - .upcast::<ValueProto<OwnedStatic<i32>, Blocking>>() + .upcast::<ValueProto<OwnedStatic<i32>, BlockingSpin>>() .is_none()); // We are done. @@ -67,10 +68,10 @@ fn sequence_has_scope_with_size_hint_and_next() { #[test] fn sequence_proto() { // The type id of the higher ranked type. - let id = TypeId::of::<SequenceProto<Blocking>>(); + let id = TypeId::of::<SequenceProto<BlockingSpin>>(); // The type id for the lifetime containing value protocol trait object. - let name_id = TypeNameId::of_lower::<dyn Sequence<Blocking>, Blocking>(); + let name_id = TypeNameId::of_lower::<dyn Sequence<BlockingSpin>, BlockingSpin>(); // They should be the same. assert_eq!(id, name_id.into_type_id()); |