NotSame asserts that two pointers do not reference the same object. assert.NotSame(t, ptr1, ptr2) Both arguments must be pointer variables. Pointer variable sameness is determined based on the equality of both type and value.
(t TestingT, expected, actual interface{}, msgAndArgs ...interface{})
| 516 | // Both arguments must be pointer variables. Pointer variable sameness is |
| 517 | // determined based on the equality of both type and value. |
| 518 | func NotSame(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { |
| 519 | if h, ok := t.(tHelper); ok { |
| 520 | h.Helper() |
| 521 | } |
| 522 | |
| 523 | if samePointers(expected, actual) { |
| 524 | return Fail(t, fmt.Sprintf( |
| 525 | "Expected and actual point to the same object: %p %#v", |
| 526 | expected, expected), msgAndArgs...) |
| 527 | } |
| 528 | return true |
| 529 | } |
| 530 | |
| 531 | // samePointers compares two generic interface objects and returns whether |
| 532 | // they point to the same object |
searching dependent graphs…