From f51c0d21fd13c5c55f57db63b2056b35e18ec40e Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 15 Oct 2023 14:36:16 +0000 Subject: [PATCH] solo tests --- src/func/instances/solo.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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(); + } +}