tests::tests
Some checks failed
buildbot/cargo fmt (1.72) Build done.
buildbot/cargo clippy (1.65) Build done.
buildbot/cargo test (1.65) Build done.
buildbot/cargo doc (1.72) Build done.
buildbot/cargo clippy (1.72) Build done.

This commit is contained in:
AF 2023-10-15 17:06:52 +00:00
parent 3fb5d996fa
commit be61a0bf3b

View File

@ -94,6 +94,37 @@ impl AddAssign<R> for R {
}
}
#[cfg(test)]
mod tests {
use super::{eqr, R};
#[test]
fn eqr_ok() {
eqr("test", 0, 0).unwrap();
}
#[test]
#[should_panic(expected = "test: 1 != 2")]
fn eqr_panic() {
eqr("test", 1, 2).unwrap();
}
#[test]
#[should_panic]
fn eqr_err_add() {
(R::default() + eqr("test", 1, 2) + eqr("test", 3, 4)).unwrap();
}
#[test]
#[should_panic]
fn eqr_err_add_assign() {
let mut r = R::default();
r += eqr("test", 1, 2);
r += eqr("test", 3, 4);
r.unwrap();
}
}
pub fn fmap_respects_identity<'a, T: Functor<'a> + Eqr<'a>, A: 'a + Send + Debug + PartialEq>(
fa0: impl Fn() -> T::F<A>,
) -> R {
@ -417,29 +448,3 @@ pub fn select_of_equal_is_same<
fa0(),
)
}
#[test]
fn eqr_ok() {
eqr("test", 0, 0).unwrap();
}
#[test]
#[should_panic(expected = "test: 1 != 2")]
fn eqr_panic() {
eqr("test", 1, 2).unwrap();
}
#[test]
#[should_panic]
fn eqr_err_add() {
(R::default() + eqr("test", 1, 2) + eqr("test", 3, 4)).unwrap();
}
#[test]
#[should_panic]
fn eqr_err_add_assign() {
let mut r = R::default();
r += eqr("test", 1, 2);
r += eqr("test", 3, 4);
r.unwrap();
}