MCPcopy Index your code
hub / github.com/google/codesearch / TestGrep

Function TestGrep

regexp/regexp_test.go:202–219  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

200}
201
202func TestGrep(t *testing.T) {
203 for i, tt := range grepTests {
204 re, err := Compile("(?m)" + tt.re)
205 if err != nil {
206 t.Errorf("Compile(%#q): %v", tt.re, err)
207 continue
208 }
209 g := tt.g
210 g.Regexp = re
211 var out, errb bytes.Buffer
212 g.Stdout = &out
213 g.Stderr = &errb
214 g.Reader(strings.NewReader(tt.s), "input")
215 if out.String() != tt.out || errb.String() != tt.err {
216 t.Errorf("#%d: grep(%#q, %q) = %q, %q, want %q, %q", i, tt.re, tt.s, out.String(), errb.String(), tt.out, tt.err)
217 }
218 }
219}

Callers

nothing calls this directly

Calls 3

CompileFunction · 0.85
ReaderMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…