more fail_follows_laws
This commit is contained in:
parent
062c532b91
commit
d2a021d813
@ -210,6 +210,15 @@ mod composition_tests {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> test_suite::FailTestSuite<'a, i32> for T {
|
||||
fn sample_fail<F: FnMut(Arc<dyn 'a + Send + Sync + Fn() -> i32>)>(mut f: F) {
|
||||
f(Arc::new(|| 0));
|
||||
f(Arc::new(|| 1));
|
||||
f(Arc::new(|| 2));
|
||||
f(Arc::new(|| 3));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn monad_follows_laws() {
|
||||
test_suite::monad_follows_laws::<T>().unwrap();
|
||||
@ -220,6 +229,11 @@ mod composition_tests {
|
||||
test_suite::shared_follows_laws::<T>().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_follows_laws() {
|
||||
test_suite::fail_functor_follows_laws::<T, _>().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn select_second() {
|
||||
type T = CompositionInstance<TryFutureInstance<i32>, ResultInstance<i32>>;
|
||||
|
@ -276,6 +276,15 @@ mod result_tests {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> test_suite::FailTestSuite<'a, i32> for T {
|
||||
fn sample_fail<F: FnMut(Arc<dyn 'a + Send + Sync + Fn() -> i32>)>(mut f: F) {
|
||||
f(Arc::new(|| 0));
|
||||
f(Arc::new(|| 1));
|
||||
f(Arc::new(|| 2));
|
||||
f(Arc::new(|| 3));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn monad_follows_laws() {
|
||||
test_suite::monad_follows_laws::<T>().unwrap();
|
||||
@ -285,4 +294,9 @@ mod result_tests {
|
||||
fn shared_follows_laws() {
|
||||
test_suite::shared_follows_laws::<T>().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_follows_laws() {
|
||||
test_suite::fail_functor_follows_laws::<T, _>().unwrap();
|
||||
}
|
||||
}
|
||||
|
@ -239,6 +239,15 @@ mod tryfuture_tests {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> test_suite::FailTestSuite<'a, i32> for T {
|
||||
fn sample_fail<F: FnMut(Arc<dyn 'a + Send + Sync + Fn() -> i32>)>(mut f: F) {
|
||||
f(Arc::new(|| 0));
|
||||
f(Arc::new(|| 1));
|
||||
f(Arc::new(|| 2));
|
||||
f(Arc::new(|| 3));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn monad_follows_laws() {
|
||||
test_suite::monad_follows_laws::<T>().unwrap();
|
||||
@ -258,4 +267,9 @@ mod tryfuture_tests {
|
||||
fn shared_follows_laws() {
|
||||
test_suite::shared_follows_laws::<T>().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_follows_laws() {
|
||||
test_suite::fail_functor_follows_laws::<T, _>().unwrap();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user