MCPcopy
hub / github.com/stretchr/testify / Assert

Method Assert

mock/mock.go:1061–1078  ·  view source on GitHub ↗

Assert compares the arguments with the specified objects and fails if they do not exactly match.

(t TestingT, objects ...interface{})

Source from the content-addressed store, hash-verified

1059// Assert compares the arguments with the specified objects and fails if
1060// they do not exactly match.
1061func (args Arguments) Assert(t TestingT, objects ...interface{}) bool {
1062 if h, ok := t.(tHelper); ok {
1063 h.Helper()
1064 }
1065
1066 // get the differences
1067 diff, diffCount := args.Diff(objects)
1068
1069 if diffCount == 0 {
1070 return true
1071 }
1072
1073 // there are differences... report them...
1074 t.Logf(diff)
1075 t.Errorf("%sArguments do not match.", assert.CallerInfo())
1076
1077 return false
1078}
1079
1080// String gets the argument at the specified index. Panics if there is no argument, or
1081// if the argument is of the wrong type.

Callers 1

Test_Arguments_AssertFunction · 0.45

Calls 5

DiffMethod · 0.95
CallerInfoFunction · 0.92
HelperMethod · 0.65
LogfMethod · 0.65
ErrorfMethod · 0.65

Tested by 1

Test_Arguments_AssertFunction · 0.36