MCPcopy
hub / github.com/cli/cli / ExpectLines

Function ExpectLines

test/helpers.go:49–59  ·  view source on GitHub ↗

Deprecated: prefer exact matches for command output

(t T, output string, lines ...string)

Source from the content-addressed store, hash-verified

47
48// Deprecated: prefer exact matches for command output
49func ExpectLines(t T, output string, lines ...string) {
50 t.Helper()
51 var r *regexp.Regexp
52 for _, l := range lines {
53 r = regexp.MustCompile(l)
54 if !r.MatchString(output) {
55 t.Errorf("output did not match regexp /%s/\n> output\n%s\n", r, output)
56 return
57 }
58 }
59}

Callers 10

TestIssueList_nonttyFunction · 0.92
TestPRView_PreviewFunction · 0.92
TestPRView_tty_CommentsFunction · 0.92
Test_PreserveInputFunction · 0.92

Calls 2

HelperMethod · 0.65
ErrorfMethod · 0.65

Tested by 10

TestIssueList_nonttyFunction · 0.74
TestPRView_PreviewFunction · 0.74
TestPRView_tty_CommentsFunction · 0.74
Test_PreserveInputFunction · 0.74