MCPcopy Create free account
hub / github.com/imroc/req / AssertErrorContains

Function AssertErrorContains

internal/tests/assert.go:42–50  ·  view source on GitHub ↗
(t *testing.T, err error, s string)

Source from the content-addressed store, hash-verified

40}
41
42func AssertErrorContains(t *testing.T, err error, s string) {
43 if err == nil {
44 t.Error("err is nil")
45 return
46 }
47 if !strings.Contains(err.Error(), s) {
48 t.Errorf("%q is not included in error %q", s, err.Error())
49 }
50}
51
52func AssertContains(t *testing.T, s, substr string, shouldContain bool) {
53 s = strings.ToLower(s)

Callers 4

TestSetFileUploadCheckFunction · 0.92
TestSetFileFunction · 0.92
TestAuthenticateFunction · 0.92

Calls 2

ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by 4

TestSetFileUploadCheckFunction · 0.74
TestSetFileFunction · 0.74
TestAuthenticateFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…