Diffstat (limited to 'tests/protocol_visitor_request_hint.rs')
-rw-r--r--tests/protocol_visitor_request_hint.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/protocol_visitor_request_hint.rs b/tests/protocol_visitor_request_hint.rs
index f43f2d5..52b4c2a 100644
--- a/tests/protocol_visitor_request_hint.rs
+++ b/tests/protocol_visitor_request_hint.rs
@@ -1,5 +1,6 @@
use std::any::TypeId;
+use effectful::blocking::BlockingSpin;
use common::{
protocol::{hint::MockHintWalker, request_hint::MockRequestHintVisitor},
walker::MockWalker,
@@ -14,20 +15,20 @@ use treaty::{
Flow,
};
-use crate::common::{protocol::hint::KnownFactory, Blocking};
+use crate::common::{protocol::hint::KnownFactory};
use effectful::bound::Dynamic;
mod common;
#[test]
fn hints_can_be_requested() {
- let mut mock = MockRequestHintVisitor::<Blocking>::new();
+ let mut mock = MockRequestHintVisitor::<BlockingSpin>::new();
// We will request a hint from the visitor.
mock.expect_request_hint().once().returning(|mut walker| {
// Lookup the value protocol on the walker.
let obj = walker
- .upcast_mut::<HintProto<ValueProto<OwnedStatic<i32>, Blocking>>>()
+ .upcast_mut::<HintProto<ValueProto<OwnedStatic<i32>, BlockingSpin>>>()
.unwrap();
// Get the known for the value protocol.
@@ -43,19 +44,19 @@ fn hints_can_be_requested() {
});
// This mock becomes the visitor.
- let visitor: &mut dyn RequestHint<Blocking> = &mut mock;
+ let visitor: &mut dyn RequestHint<BlockingSpin> = &mut mock;
- let mut mock = MockWalker::<(), (), Blocking>::new();
+ let mut mock = MockWalker::<(), (), BlockingSpin>::new();
// The visitor will lookup the value protocol on the walker.
mock.expect_traits_mut()
.once()
.with(eq(TypeNameId::of::<
- HintProto<ValueProto<OwnedStatic<i32>, Blocking>>,
- Blocking,
+ HintProto<ValueProto<OwnedStatic<i32>, BlockingSpin>>,
+ BlockingSpin,
>()))
.returning(|_id| {
- let mut mock = MockHintWalker::<ValueProto<OwnedStatic<i32>, Blocking>>::new();
+ let mut mock = MockHintWalker::<ValueProto<OwnedStatic<i32>, BlockingSpin>>::new();
// Expect to give a known for the value protocol to the visitor.
mock.expect_known().once().return_const(
@@ -63,7 +64,7 @@ fn hints_can_be_requested() {
Ok(ValueKnown {
preview: Some(Dynamic(&OwnedStatic(42))),
})
- }) as KnownFactory<ValueProto<OwnedStatic<i32>, Blocking>>,
+ }) as KnownFactory<ValueProto<OwnedStatic<i32>, BlockingSpin>>,
);
Some(Box::new(mock))
@@ -79,10 +80,10 @@ fn hints_can_be_requested() {
#[test]
fn request_hint_proto() {
// The type id of the higher ranked type.
- let id = TypeId::of::<RequestHintProto<Blocking>>();
+ let id = TypeId::of::<RequestHintProto<BlockingSpin>>();
// The type id for the lifetime containing value protocol trait object.
- let name_id = TypeNameId::of_lower::<dyn RequestHint<Blocking>, Blocking>();
+ let name_id = TypeNameId::of_lower::<dyn RequestHint<BlockingSpin>, BlockingSpin>();
// They should be the same.
assert_eq!(id, name_id.into_type_id());