#![cfg(test)]
use assert_rs::*;
#[test]
fn succeed() -> impl Assertion {
succeed!()
}
#[test]
fn fail() -> impl Assertion {
fail!().should_fail()
}
#[test]
#[should_panic = "failed assertion was unwrapped:\nassertion starting at tests/basic.rs:18:5 was forced fail"]
#[allow(clippy::unwrap_used, reason = "verifies that Assert::fail returns Err")]
fn fail_sanity_check() {
fail!().unwrap();
}
#[test]
#[should_panic = "failed assertion was unwrapped:\nassertion expected to fail succeeded:\nassertion starting at tests/basic.rs:28:5 was forced success"]
#[allow(
clippy::unwrap_used,
reason = "verifies that should_fail will fail on a success"
)]
fn should_fail_should_fail() {
succeed!().should_fail().unwrap();
}
#[test]
fn shouldnt_fail_shouldnt_fail() -> impl Assertion {
succeed!().should_fail().should_fail()
}
#[test]
fn is_true() -> impl Assertion {
assert_that!(true).is_true()
}
#[test]
fn isnt_true() -> impl Assertion {
assert_that!(false).is_true().should_fail()
}
#[test]
fn is_false() -> impl Assertion {
assert_that!(false).is_false()
}
#[test]
fn isnt_false() -> impl Assertion {
assert_that!(true).is_false().should_fail()
}