MCPcopy Create free account
hub / github.com/stretchr/testify / Exactly

Function Exactly

assert/assertions.go:655–669  ·  view source on GitHub ↗

Exactly asserts that two objects are equal in value and type. assert.Exactly(t, int32(123), int64(123))

(t TestingT, expected, actual interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

653//
654// assert.Exactly(t, int32(123), int64(123))
655func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
656 if h, ok := t.(tHelper); ok {
657 h.Helper()
658 }
659
660 aType := reflect.TypeOf(expected)
661 bType := reflect.TypeOf(actual)
662
663 if aType != bType {
664 return Fail(t, fmt.Sprintf("Types expected to match exactly\n\t%v != %v", aType, bType), msgAndArgs...)
665 }
666
667 return Equal(t, expected, actual, msgAndArgs...)
668
669}
670
671// NotNil asserts that the specified object is not nil.
672//

Callers 4

ExactlyFunction · 0.92
ExactlyfFunction · 0.70
TestExactlyFunction · 0.70
ExactlyMethod · 0.70

Calls 3

FailFunction · 0.70
EqualFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestExactlyFunction · 0.56