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

Method NotHasSuffix

string.go:715–735  ·  view source on GitHub ↗

NotHasSuffix succeeds if string doesn't have given Go string as suffix Example: str := NewString(t, "Hello World") str.NotHasSuffix("Hello")

(value string)

Source from the content-addressed store, hash-verified

713// str := NewString(t, "Hello World")
714// str.NotHasSuffix("Hello")
715func (s *String) NotHasSuffix(value string) *String {
716 opChain := s.chain.enter("NotHasSuffix()")
717 defer opChain.leave()
718
719 if opChain.failed() {
720 return s
721 }
722
723 if strings.HasSuffix(s.value, value) {
724 opChain.fail(AssertionFailure{
725 Type: AssertNotContainsSubset,
726 Actual: &AssertionValue{s.value},
727 Expected: &AssertionValue{value},
728 Errors: []error{
729 errors.New("expected: string doesn't have suffix"),
730 },
731 })
732 }
733
734 return s
735}
736
737// HasPrefixFold succeeds if string has given Go string as prefix
738// after applying Unicode case-folding (so it's a case-insensitive match).

Callers 2

TestString_FailedChainFunction · 0.80
TestString_HasSuffixFunction · 0.80

Calls 5

enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
HasSuffixMethod · 0.80
failMethod · 0.80

Tested by 2

TestString_FailedChainFunction · 0.64
TestString_HasSuffixFunction · 0.64