MCPcopy Index your code
hub / github.com/imroc/req / AssertContains

Function AssertContains

internal/tests/assert.go:52–64  ·  view source on GitHub ↗
(t *testing.T, s, substr string, shouldContain bool)

Source from the content-addressed store, hash-verified

50}
51
52func AssertContains(t *testing.T, s, substr string, shouldContain bool) {
53 s = strings.ToLower(s)
54 isContain := strings.Contains(s, substr)
55 if shouldContain {
56 if !isContain {
57 t.Errorf("%q is not included in %s", substr, s)
58 }
59 } else {
60 if isContain {
61 t.Errorf("%q is included in %q", substr, s)
62 }
63 }
64}
65
66func AssertClone(t *testing.T, e, g any) {
67 ev := reflect.ValueOf(e).Elem()

Callers 9

TestLoggerFunction · 0.92
TestAutoDecodeFunction · 0.92
TestRedirectFunction · 0.92
testEnableDumpAllFunction · 0.92
TestEnableDumpAllToFileFunction · 0.92
testEnableDumpFunction · 0.92
assertTraceInfoFunction · 0.92
TestUploadMultipartFunction · 0.92

Calls 1

ErrorfMethod · 0.65

Tested by 9

TestLoggerFunction · 0.74
TestAutoDecodeFunction · 0.74
TestRedirectFunction · 0.74
testEnableDumpAllFunction · 0.74
TestEnableDumpAllToFileFunction · 0.74
testEnableDumpFunction · 0.74
assertTraceInfoFunction · 0.74
TestUploadMultipartFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…