1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:00:09 -07:00

regexp: add explicit test for bytes version of match function

This commit is contained in:
Anuraag Agrawal 2022-11-29 13:41:57 +09:00
parent 0fd7be7ee5
commit 560c3afed1

View File

@ -107,6 +107,11 @@ func matchFunctionTest(t *testing.T, test *FindTest) {
if m != (len(test.matches) > 0) {
t.Errorf("Match failure on %s: %t should be %t", test, m, len(test.matches) > 0)
}
// now try bytes
m, err = Match(test.pat, []byte(test.text))
if m != (len(test.matches) > 0) {
t.Errorf("Match failure on %s: %t should be %t", test, m, len(test.matches) > 0)
}
}
func TestMatchFunction(t *testing.T) {