Diffstat (limited to 'tests/walker_struct.rs')
-rw-r--r--tests/walker_struct.rs41
1 files changed, 21 insertions, 20 deletions
diff --git a/tests/walker_struct.rs b/tests/walker_struct.rs
index 9872d63..9bd2a0c 100644
--- a/tests/walker_struct.rs
+++ b/tests/walker_struct.rs
@@ -1,7 +1,8 @@
use effectful::{
- bound::{Dynamic, DynamicShim, ForceDynamic},
- effective::Effective,
- environment::{DynBind, Environment, NativeForm},
+ bound::{Dynamic, ForceDynamic},
+ effective::{Effective, Canonical},
+ environment::{Environment},
+ DynBind,
SendSync,
};
use mockall::predicate::eq;
@@ -14,11 +15,11 @@ use treaty::{
walk::walkers::core::r#struct::{StructTypeInfo, StructWalker},
DefaultMode, Flow, Walker,
};
+use effectful::blocking::BlockingSpin;
use crate::common::{
builder::{EmptyError, MockBuilder},
protocol::{sequence::MockSequenceVisitor, tag::MockTagVisitor, value::MockValueVisitor},
- Blocking,
};
mod common;
@@ -51,7 +52,7 @@ where
index: usize,
value: &'ctx Self::T,
mut visitor: DynVisitor<'a, 'ctx, E>,
- ) -> NativeForm<'a, Result<Flow, Self::FieldError>, E> {
+ ) -> Canonical<'a, Result<Flow, Self::FieldError>, E> {
E::future(unsafe {
ForceDynamic::new(async move {
match index {
@@ -104,17 +105,17 @@ fn sequence_of_field_values() {
let value = X { a: true, b: 42 };
// The struct walker using the info we provided about the struct.
- let walker = StructWalker::<Info, _, DefaultMode, Blocking>::new(&value);
+ let walker = StructWalker::<Info, _, DefaultMode, BlockingSpin>::new(&value);
- let mut builder = MockBuilder::<(), (), EmptyError, Blocking>::new();
+ let mut builder = MockBuilder::<(), (), EmptyError, BlockingSpin>::new();
// Expect a visit on the sequence protocol for the struct fields.
builder
.expect_traits_mut()
.once()
- .with(eq(TypeNameId::of::<SequenceProto<Blocking>, Blocking>()))
+ .with(eq(TypeNameId::of::<SequenceProto<BlockingSpin>, BlockingSpin>()))
.returning(|_| {
- let mut visitor = MockSequenceVisitor::<Blocking>::new();
+ let mut visitor = MockSequenceVisitor::<BlockingSpin>::new();
// Expect the sequence visitor to be used.
visitor.expect_visit().once().returning(|scope| {
@@ -123,19 +124,19 @@ fn sequence_of_field_values() {
// Get the first field value.
{
- let mut visitor = MockBuilder::<(), (), EmptyError, Blocking>::new();
+ let mut visitor = MockBuilder::<(), (), EmptyError, BlockingSpin>::new();
// Expect a bool value for the field.
visitor
.expect_traits_mut()
.once()
.with(eq(TypeNameId::of::<
- ValueProto<OwnedStatic<bool>, Blocking>,
- Blocking,
+ ValueProto<OwnedStatic<bool>, BlockingSpin>,
+ BlockingSpin,
>()))
.returning(|_| {
let mut visitor =
- MockValueVisitor::<OwnedStatic<bool>, Blocking>::new();
+ MockValueVisitor::<OwnedStatic<bool>, BlockingSpin>::new();
// Expect true.
visitor
@@ -155,18 +156,18 @@ fn sequence_of_field_values() {
// Get the second field value.
{
- let mut visitor = MockBuilder::<(), (), EmptyError, Blocking>::new();
+ let mut visitor = MockBuilder::<(), (), EmptyError, BlockingSpin>::new();
// Expect a i32 value.
visitor
.expect_traits_mut()
.once()
.with(eq(TypeNameId::of::<
- ValueProto<OwnedStatic<i32>, Blocking>,
- Blocking,
+ ValueProto<OwnedStatic<i32>, BlockingSpin>,
+ BlockingSpin,
>()))
.returning(|_| {
- let mut visitor = MockValueVisitor::<OwnedStatic<i32>, Blocking>::new();
+ let mut visitor = MockValueVisitor::<OwnedStatic<i32>, BlockingSpin>::new();
// Expect a 42.
visitor
@@ -209,9 +210,9 @@ fn has_struct_tag() {
let value = X { a: true, b: 42 };
// The struct walker using the info we provided about the struct.
- let walker = StructWalker::<Info, _, DefaultMode, Blocking>::new(&value);
+ let walker = StructWalker::<Info, _, DefaultMode, BlockingSpin>::new(&value);
- let mut builder = MockBuilder::<(), (), EmptyError, Blocking>::new();
+ let mut builder = MockBuilder::<(), (), EmptyError, BlockingSpin>::new();
let mut seq = mockall::Sequence::new();
@@ -228,7 +229,7 @@ fn has_struct_tag() {
.once()
.in_sequence(&mut seq)
.with(eq(TypeNameId::of::<
- TagProto<tags::Struct, Blocking>,
+ TagProto<tags::Struct, BlockingSpin>,
Blocking,
>()))
.returning(|_| {