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

Method IsEqualFold

string.go:255–275  ·  view source on GitHub ↗

IsEqualFold succeeds if string is equal to given Go string after applying Unicode case-folding (so it's a case-insensitive match). Example: str := NewString(t, "Hello") str.IsEqualFold("hELLo")

(value string)

Source from the content-addressed store, hash-verified

253// str := NewString(t, "Hello")
254// str.IsEqualFold("hELLo")
255func (s *String) IsEqualFold(value string) *String {
256 opChain := s.chain.enter("IsEqualFold()")
257 defer opChain.leave()
258
259 if opChain.failed() {
260 return s
261 }
262
263 if !strings.EqualFold(s.value, value) {
264 opChain.fail(AssertionFailure{
265 Type: AssertEqual,
266 Actual: &AssertionValue{s.value},
267 Expected: &AssertionValue{value},
268 Errors: []error{
269 errors.New("expected: strings are equal (if folded)"),
270 },
271 })
272 }
273
274 return s
275}
276
277// NotEqualFold succeeds if string is not equal to given Go string after applying
278// Unicode case-folding (so it's a case-insensitive match).

Callers 3

EqualFoldMethod · 0.95
TestString_FailedChainFunction · 0.80
TestString_IsEqualFunction · 0.80

Calls 5

enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
EqualFoldMethod · 0.80
failMethod · 0.80

Tested by 2

TestString_FailedChainFunction · 0.64
TestString_IsEqualFunction · 0.64