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

Method LineCount

pkg/integration/components/view_driver.go:562–572  ·  view source on GitHub ↗
(matcher *IntMatcher)

Source from the content-addressed store, hash-verified

560}
561
562func (self *ViewDriver) LineCount(matcher *IntMatcher) *ViewDriver {
563 view := self.getView()
564
565 self.t.assertWithRetries(func() (bool, string) {
566 lineCount := self.getLineCount()
567 ok, _ := matcher.test(lineCount)
568 return ok, fmt.Sprintf("unexpected number of lines in view '%s'. Expected %s, got %d", view.Name(), matcher.name(), lineCount)
569 })
570
571 return self
572}
573
574func (self *ViewDriver) getLineCount() int {
575 // can't rely entirely on view.BufferLines because it returns 1 even if there's nothing in the view

Calls 6

getLineCountMethod · 0.95
assertWithRetriesMethod · 0.80
testMethod · 0.80
nameMethod · 0.80
SprintfMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected