MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestString_IsEmpty

Function TestString_IsEmpty

string_test.go:190–219  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestString_IsEmpty(t *testing.T) {
191 cases := []struct {
192 name string
193 str string
194 wantEmpty chainResult
195 }{
196 {
197 name: "empty string",
198 str: "",
199 wantEmpty: success,
200 },
201 {
202 name: "non-empty string",
203 str: "foo",
204 wantEmpty: failure,
205 },
206 }
207
208 for _, tc := range cases {
209 t.Run(tc.name, func(t *testing.T) {
210 reporter := newMockReporter(t)
211
212 NewString(reporter, tc.str).IsEmpty().
213 chain.assert(t, tc.wantEmpty)
214
215 NewString(reporter, tc.str).NotEmpty().
216 chain.assert(t, !tc.wantEmpty)
217 })
218 }
219}
220
221func TestString_IsEqual(t *testing.T) {
222 cases := []struct {

Callers

nothing calls this directly

Calls 5

newMockReporterFunction · 0.85
NewStringFunction · 0.85
assertMethod · 0.80
IsEmptyMethod · 0.45
NotEmptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…