MCPcopy Create free account
hub / github.com/cloudwan/gohan / Match

Method Match

extension/goext/test/error.go:33–39  ·  view source on GitHub ↗
(actual interface{})

Source from the content-addressed store, hash-verified

31}
32
33func (matcher *MatchErrorMatcher) Match(actual interface{}) (bool, error) {
34 error, ok := actual.(*goext.Error)
35 if !ok {
36 return false, fmt.Errorf("ErrorMatcher matcher expects an Error")
37 }
38 return error.Err.Error() == matcher.Expected.Err.Error() && error.Status == matcher.Expected.Status, nil
39}
40
41func (matcher *MatchErrorMatcher) FailureMessage(actual interface{}) (message string) {
42 return fmt.Sprintf("Expected\n\t%#v\nto be\n\t%#v", actual, matcher.Expected)

Callers 9

LoadExtensionsForPathMethod · 0.45
HandleEventMethod · 0.45
error_test.goFile · 0.45
LoadExtensionsForPathMethod · 0.45
LoadExtensionsForPathMethod · 0.45
cancelOnTimeoutMethod · 0.45
HasRoleMethod · 0.45
LoadExtensionsForPathMethod · 0.45
HandleEventMethod · 0.45

Calls 2

ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected