MCPcopy
hub / github.com/jesseduffield/lazygit / Contains

Method Contains

pkg/integration/components/text_matcher.go:17–31  ·  view source on GitHub ↗
(target string)

Source from the content-addressed store, hash-verified

15}
16
17func (self *TextMatcher) Contains(target string) *TextMatcher {
18 self.appendRule(matcherRule[string]{
19 name: fmt.Sprintf("contains '%s'", target),
20 testFn: func(value string) (bool, string) {
21 // everything contains the empty string so we unconditionally return true here
22 if target == "" {
23 return true, ""
24 }
25
26 return strings.Contains(value, target), fmt.Sprintf("Expected '%s' to be found in '%s'", target, value)
27 },
28 })
29
30 return self
31}
32
33func (self *TextMatcher) DoesNotContain(target string) *TextMatcher {
34 self.appendRule(matcherRule[string]{

Calls 2

appendRuleMethod · 0.80
SprintfMethod · 0.65

Tested by 3

renderLayoutFunction · 0.64