solo tests
This commit is contained in:
parent
30497ac69c
commit
f51c0d21fd
@ -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<A: 'a + Send + PartialEq + std::fmt::Debug>(
|
||||
name: &'a str,
|
||||
left: Self::F<A>,
|
||||
right: Self::F<A>,
|
||||
) -> tests::R {
|
||||
tests::eqr(name, left, right)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> test_suite::FunctorTestSuite<'a> for T {
|
||||
fn sample<A: 'a + Send, F: FnMut(&'a (dyn Send + Sync + Fn(A) -> Self::F<A>))>(mut f: F) {
|
||||
f(&|a| a);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn monad_follows_laws() {
|
||||
test_suite::monad_follows_laws::<T>().unwrap();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user