MCPcopy Create free account
hub / github.com/expr-lang/expr / Same

Function Same

internal/testify/assert/assertions.go:498–510  ·  view source on GitHub ↗

Same asserts that two pointers reference the same object. assert.Same(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{})

Source from the content-addressed store, hash-verified

496// Both arguments must be pointer variables. Pointer variable sameness is
497// determined based on the equality of both type and value.
498func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
499 if h, ok := t.(tHelper); ok {
500 h.Helper()
501 }
502
503 if !samePointers(expected, actual) {
504 return Fail(t, fmt.Sprintf("Not same: \n"+
505 "expected: %p %#v\n"+
506 "actual : %p %#v", expected, expected, actual, actual), msgAndArgs...)
507 }
508
509 return true
510}
511
512// NotSame asserts that two pointers do not reference the same object.
513//

Callers 4

SameFunction · 0.92
SamefFunction · 0.70
TestSameFunction · 0.70
SameMethod · 0.70

Calls 4

samePointersFunction · 0.85
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestSameFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…