diff --git a/src/func/instances/solo.rs b/src/func/instances/solo.rs index 4453f89..a06b7e9 100644 --- a/src/func/instances/solo.rs +++ b/src/func/instances/solo.rs @@ -116,3 +116,31 @@ impl<'a> Fail<'a, std::convert::Infallible> for SoloInstance { match e {} } } + +#[cfg(test)] +mod solo_tests { + use super::{test_suite, tests, SoloInstance}; + + type T = SoloInstance; + + impl<'a> tests::Eqr<'a> for T { + fn eqr( + name: &'a str, + left: Self::F, + right: Self::F, + ) -> tests::R { + tests::eqr(name, left, right) + } + } + + impl<'a> test_suite::FunctorTestSuite<'a> for T { + fn sample Self::F))>(mut f: F) { + f(&|a| a); + } + } + + #[test] + fn monad_follows_laws() { + test_suite::monad_follows_laws::().unwrap(); + } +}