pub fn eq_deref_of<ActualT: ?Sized, ExpectedRefT>(
    expected: ExpectedRefT
) -> EqDerefOfMatcher<ActualT, ExpectedRefT>
Expand description

Matches a value equal (in the sense of ==) to the dereferenced value of expected.

This is similar to eq but takes a reference or smart pointer to the expected value rather than consuming it. This is useful when:

  • one has only a reference to the expected value, and
  • the expected value cannot or should not be copied or cloned to create an owned value from it.
#[derive(Debug, PartialEq)]
struct NonCloneableStruct(i32);
let expected = NonCloneableStruct(123);
verify_that!(NonCloneableStruct(123), eq_deref_of(&expected))

Note: while one can use eq_deref_of with the configuration methods of StrMatcherConfigurator to configure string equality, it is not possible to do so when the input is a smart pointer to a string.

verify_that!("A string", eq_deref_of(Box::new("A STRING")).ignoring_ascii_case()) // Does not compile

Otherwise, this has the same behaviour as eq.