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

Method NotHasPrefixFold

string.go:773–793  ·  view source on GitHub ↗

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

(value string)

Source from the content-addressed store, hash-verified

771// str := NewString(t, "Hello World")
772// str.NotHasPrefixFold("Bye")
773func (s *String) NotHasPrefixFold(value string) *String {
774 opChain := s.chain.enter("NotHasPrefixFold()")
775 defer opChain.leave()
776
777 if opChain.failed() {
778 return s
779 }
780
781 if strings.HasPrefix(strings.ToLower(s.value), strings.ToLower(value)) {
782 opChain.fail(AssertionFailure{
783 Type: AssertNotContainsSubset,
784 Actual: &AssertionValue{s.value},
785 Expected: &AssertionValue{value},
786 Errors: []error{
787 errors.New("expected: string doesn't have prefix (if folded)"),
788 },
789 })
790 }
791
792 return s
793}
794
795// HasSuffixFold succeeds if string has given Go string as suffix
796// after applying Unicode case-folding (so it's a case-insensitive match).

Callers 2

TestString_FailedChainFunction · 0.80
TestString_HasPrefixFunction · 0.80

Calls 5

enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
HasPrefixMethod · 0.80
failMethod · 0.80

Tested by 2

TestString_FailedChainFunction · 0.64
TestString_HasPrefixFunction · 0.64