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

Method NotHasSuffixFold

string.go:831–851  ·  view source on GitHub ↗

NotHasSuffixFold succeeds if string doesn't have given Go string as suffix after applying Unicode case-folding (so it's a case-insensitive match). Example: str := NewString(t, "Hello World") str.NotHasSuffixFold("Bye")

(value string)

Source from the content-addressed store, hash-verified

829// str := NewString(t, "Hello World")
830// str.NotHasSuffixFold("Bye")
831func (s *String) NotHasSuffixFold(value string) *String {
832 opChain := s.chain.enter("NotHasSuffix()")
833 defer opChain.leave()
834
835 if opChain.failed() {
836 return s
837 }
838
839 if strings.HasSuffix(strings.ToLower(s.value), strings.ToLower(value)) {
840 opChain.fail(AssertionFailure{
841 Type: AssertNotContainsSubset,
842 Actual: &AssertionValue{s.value},
843 Expected: &AssertionValue{value},
844 Errors: []error{
845 errors.New("expected: string doesn't have suffix (if folded)"),
846 },
847 })
848 }
849
850 return s
851}
852
853// Match matches the string with given regexp and returns a new Match instance
854// with found submatches.

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