Function galvanic_assert::matchers::same_object [] [src]

pub fn same_object<'a, T>(expected: &'a T) -> Box<Matcher<'a, T> + 'a> where
    T: Debug + 'a, 

Matches if asserted value and the expected value are truely the same object.

The two values are the same if the reside at the same memory address.

Examples

use galvanic_assert::matchers::*;
#[derive(Debug)]
struct Foo;
let foo1 = Foo;
let foo2 = Foo;

assert_that!(&foo1, same_object(&foo1));

assert_that!(
    assert_that!(&foo1, same_object(&foo2)),
    panics
);