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

Function TestMatch

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

Source from the content-addressed store, hash-verified

148}
149
150func TestMatch(t *testing.T) {
151 for _, tt := range matchTests {
152 re, err := Compile("(?m)" + tt.re)
153 if err != nil {
154 t.Errorf("Compile(%#q): %v", tt.re, err)
155 continue
156 }
157 b := []byte(tt.s)
158 lines := grep(re, b)
159 if !reflect.DeepEqual(lines, tt.m) {
160 t.Errorf("grep(%#q, %q) = %v, want %v", tt.re, tt.s, lines, tt.m)
161 }
162 }
163}
164
165func grep(re *Regexp, b []byte) []int {
166 var m []int

Callers

nothing calls this directly

Calls 2

CompileFunction · 0.85
grepFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…