MCPcopy Index your code
hub / github.com/cli/cli / assertLineFound

Function assertLineFound

internal/docs/man_test.go:290–303  ·  view source on GitHub ↗
(scanner *bufio.Scanner, expectedLine string)

Source from the content-addressed store, hash-verified

288}
289
290func assertLineFound(scanner *bufio.Scanner, expectedLine string) error {
291 for scanner.Scan() {
292 line := scanner.Text()
293 if line == expectedLine {
294 return nil
295 }
296 }
297
298 if err := scanner.Err(); err != nil {
299 return fmt.Errorf("scan failed: %s", err)
300 }
301
302 return fmt.Errorf("hit EOF before finding %v", expectedLine)
303}
304
305func BenchmarkGenManToFile(b *testing.B) {
306 file, err := os.CreateTemp(b.TempDir(), "")

Callers 1

TestGenManSeeAlsoFunction · 0.85

Calls 2

ErrMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected