diff --git a/regex/re_test.go b/regex/re_test.go index b8b1381..de6aaba 100644 --- a/regex/re_test.go +++ b/regex/re_test.go @@ -790,6 +790,13 @@ func TestFindSubmatch(t *testing.T) { } } match, err := regComp.FindSubmatch(test.str) + if err != nil { + if len(test.result) != 0 { + t.Errorf("Wanted %v got no match\n", test.result[0]) + } + } else if len(test.result) == 0 { + t.Errorf("Wanted no match got %v\n", match) + } for i := range match { if match[i].IsValid() { if test.result[0][i] != match[i] {