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

Function TestString_HasPrefix

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

Source from the content-addressed store, hash-verified

373}
374
375func TestString_HasPrefix(t *testing.T) {
376 cases := []struct {
377 name string
378 str string
379 value string
380 wantHasPrefix chainResult
381 wantHasPrefixFold chainResult
382 }{
383 {
384 name: "has prefix",
385 str: "Hello World",
386 value: "Hello",
387 wantHasPrefix: success,
388 wantHasPrefixFold: success,
389 },
390 {
391 name: "full match",
392 str: "Hello World",
393 value: "Hello World",
394 wantHasPrefix: success,
395 wantHasPrefixFold: success,
396 },
397 {
398 name: "empty string",
399 str: "Hello World",
400 value: "",
401 wantHasPrefix: success,
402 wantHasPrefixFold: success,
403 },
404 {
405 name: "extra char",
406 str: "Hello World",
407 value: "Hello!",
408 wantHasPrefix: failure,
409 wantHasPrefixFold: failure,
410 },
411 {
412 name: "different case",
413 str: "Hello World",
414 value: "hell",
415 wantHasPrefix: failure,
416 wantHasPrefixFold: success,
417 },
418 {
419 name: "different case extra char",
420 str: "Hello World",
421 value: "hella",
422 wantHasPrefix: failure,
423 wantHasPrefixFold: failure,
424 },
425 {
426 name: "different case full match",
427 str: "Hello World",
428 value: "hELLO wORLD",
429 wantHasPrefix: failure,
430 wantHasPrefixFold: success,
431 },
432 }

Callers

nothing calls this directly

Calls 7

newMockReporterFunction · 0.85
NewStringFunction · 0.85
assertMethod · 0.80
HasPrefixMethod · 0.80
NotHasPrefixMethod · 0.80
HasPrefixFoldMethod · 0.80
NotHasPrefixFoldMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…