(t *testing.T, test *FindTest)
| 73 | } |
| 74 | |
| 75 | func matchTest(t *testing.T, test *FindTest) { |
| 76 | re := compileTest(t, test.pat, nil) |
| 77 | if re == nil { |
| 78 | return |
| 79 | } |
| 80 | m := re.MatchString(test.text) |
| 81 | if m != (len(test.matches) > 0) { |
| 82 | t.Errorf("MatchString failure on %s: %t should be %t", test, m, len(test.matches) > 0) |
| 83 | } |
| 84 | // now try bytes |
| 85 | m = re.Match([]byte(test.text)) |
| 86 | if m != (len(test.matches) > 0) { |
| 87 | t.Errorf("Match failure on %s: %t should be %t", test, m, len(test.matches) > 0) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func TestMatch(t *testing.T) { |
| 92 | for _, test := range findTests { |
no test coverage detected