MCPcopy Create free account
hub / github.com/gavv/httpexpect / HasSuffixFold

Method HasSuffixFold

string.go:802–822  ·  view source on GitHub ↗

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

(value string)

Source from the content-addressed store, hash-verified

800// str := NewString(t, "Hello World")
801// str.HasSuffixFold("world")
802func (s *String) HasSuffixFold(value string) *String {
803 opChain := s.chain.enter("HasSuffixFold()")
804 defer opChain.leave()
805
806 if opChain.failed() {
807 return s
808 }
809
810 if !strings.HasSuffix(strings.ToLower(s.value), strings.ToLower(value)) {
811 opChain.fail(AssertionFailure{
812 Type: AssertContainsSubset,
813 Actual: &AssertionValue{s.value},
814 Expected: &AssertionValue{value},
815 Errors: []error{
816 errors.New("expected: string has suffix (if folded)"),
817 },
818 })
819 }
820
821 return s
822}
823
824// NotHasSuffixFold succeeds if string doesn't have given Go string as suffix
825// 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