more fail_follows_laws
All checks were successful
buildbot/cargo fmt (1.72) Build done.
buildbot/cargo clippy (1.72) Build done.
buildbot/cargo doc (1.72) Build done.
buildbot/cargo test (1.65) Build done.
buildbot/cargo clippy (1.65) Build done.

This commit is contained in:
AF 2023-10-15 18:17:57 +00:00
parent 062c532b91
commit d2a021d813
3 changed files with 42 additions and 0 deletions

View File

@ -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>>;

View File

@ -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();
}
}

View File

@ -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();
}
}