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

Method ContainsFold

string.go:574–594  ·  view source on GitHub ↗

ContainsFold succeeds if string contains given Go string as a substring after applying Unicode case-folding (so it's a case-insensitive match). Example: str := NewString(t, "Hello") str.ContainsFold("ELL")

(value string)

Source from the content-addressed store, hash-verified

572// str := NewString(t, "Hello")
573// str.ContainsFold("ELL")
574func (s *String) ContainsFold(value string) *String {
575 opChain := s.chain.enter("ContainsFold()")
576 defer opChain.leave()
577
578 if opChain.failed() {
579 return s
580 }
581
582 if !strings.Contains(strings.ToLower(s.value), strings.ToLower(value)) {
583 opChain.fail(AssertionFailure{
584 Type: AssertContainsSubset,
585 Actual: &AssertionValue{s.value},
586 Expected: &AssertionValue{value},
587 Errors: []error{
588 errors.New("expected: string contains sub-string (if folded)"),
589 },
590 })
591 }
592
593 return s
594}
595
596// NotContainsFold succeeds if string doesn't contain given Go string as a substring
597// after applying Unicode case-folding (so it's a case-insensitive match).

Callers 2

TestString_FailedChainFunction · 0.80
TestString_ContainsFunction · 0.80

Calls 5

enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
failMethod · 0.80
ContainsMethod · 0.45

Tested by 2

TestString_FailedChainFunction · 0.64
TestString_ContainsFunction · 0.64