Function not_equal

Source
pub fn not_equal<A, T, B>(a: A, b: B)
where A: Debug + Unwrappable<T, B>, B: Debug + PartialEq<A::Output>,
Expand description

Asserts two values are not equal using PartialEq, allowing for different types to be compared. Automatically unwraps Result and Option, failing the test if the value is Err or None. This is useful for removing boilerplate .unwrap().unwrap() calls in tests.

Error message will show the values that were compared using pretty_assertions crate.

ยงExample

use common_testing::assert;

#[test]
fn test_1() {
  let result = "abc";
  not_equal(result, "def");
  not_equal(result.as_bytes(), b"bcd");
}