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

Function TestString_IsEqual

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

Source from the content-addressed store, hash-verified

219}
220
221func TestString_IsEqual(t *testing.T) {
222 cases := []struct {
223 name string
224 str string
225 value string
226 wantEqual chainResult
227 wantEqualFold chainResult
228 }{
229 {
230 name: "equivalent string",
231 str: "foo",
232 value: "foo",
233 wantEqual: success,
234 wantEqualFold: success,
235 },
236 {
237 name: "non-equivalent string",
238 str: "foo",
239 value: "bar",
240 wantEqual: failure,
241 wantEqualFold: failure,
242 },
243 {
244 name: "different case",
245 str: "foo",
246 value: "FOO",
247 wantEqual: failure,
248 wantEqualFold: success,
249 },
250 }
251
252 for _, tc := range cases {
253 reporter := newMockReporter(t)
254
255 NewString(reporter, tc.str).IsEqual(tc.value).
256 chain.assert(t, tc.wantEqual)
257 NewString(reporter, tc.str).NotEqual(tc.value).
258 chain.assert(t, !tc.wantEqual)
259
260 NewString(reporter, tc.str).IsEqualFold(tc.value).
261 chain.assert(t, tc.wantEqualFold)
262 NewString(reporter, tc.str).NotEqualFold(tc.value).
263 chain.assert(t, !tc.wantEqualFold)
264 }
265}
266
267func TestString_InList(t *testing.T) {
268 t.Run("basic", func(t *testing.T) {

Callers

nothing calls this directly

Calls 7

newMockReporterFunction · 0.85
NewStringFunction · 0.85
assertMethod · 0.80
IsEqualFoldMethod · 0.80
NotEqualFoldMethod · 0.80
IsEqualMethod · 0.45
NotEqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…