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

Function TestString_HasSuffix

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

Source from the content-addressed store, hash-verified

447}
448
449func TestString_HasSuffix(t *testing.T) {
450 cases := []struct {
451 name string
452 str string
453 value string
454 wantHasSuffix chainResult
455 wantHasSuffixFold chainResult
456 }{
457 {
458 name: "has suffix",
459 str: "Hello World",
460 value: "World",
461 wantHasSuffix: success,
462 wantHasSuffixFold: success,
463 },
464 {
465 name: "full match",
466 str: "Hello World",
467 value: "Hello World",
468 wantHasSuffix: success,
469 wantHasSuffixFold: success,
470 },
471 {
472 name: "empty string",
473 str: "Hello World",
474 value: "",
475 wantHasSuffix: success,
476 wantHasSuffixFold: success,
477 },
478 {
479 name: "extra char",
480 str: "Hello World",
481 value: "!World",
482 wantHasSuffix: failure,
483 wantHasSuffixFold: failure,
484 },
485 {
486 name: "different case",
487 str: "Hello World",
488 value: "WORLD",
489 wantHasSuffix: failure,
490 wantHasSuffixFold: success,
491 },
492 {
493 name: "different case extra char",
494 str: "Hello World",
495 value: "!WORLD",
496 wantHasSuffix: failure,
497 wantHasSuffixFold: failure,
498 },
499 {
500 name: "different case full match",
501 str: "Hello World",
502 value: "hELLO wORLD",
503 wantHasSuffix: failure,
504 wantHasSuffixFold: success,
505 },
506 }

Callers

nothing calls this directly

Calls 7

newMockReporterFunction · 0.85
NewStringFunction · 0.85
assertMethod · 0.80
HasSuffixMethod · 0.80
NotHasSuffixMethod · 0.80
HasSuffixFoldMethod · 0.80
NotHasSuffixFoldMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…