diff options
Diffstat (limited to 'src/pkg/regexp/find_test.go')
-rw-r--r-- | src/pkg/regexp/find_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/pkg/regexp/find_test.go b/src/pkg/regexp/find_test.go index 1690711dd..83b249e3c 100644 --- a/src/pkg/regexp/find_test.go +++ b/src/pkg/regexp/find_test.go @@ -6,6 +6,7 @@ package regexp import ( "fmt" + "strings" "testing" ) @@ -191,6 +192,12 @@ func TestFindStringIndex(t *testing.T) { } } +func TestFindReaderIndex(t *testing.T) { + for _, test := range findTests { + testFindIndex(&test, MustCompile(test.pat).FindReaderIndex(strings.NewReader(test.text)), t) + } +} + // Now come the simple All cases. func TestFindAll(t *testing.T) { @@ -381,12 +388,18 @@ func TestFindSubmatchIndex(t *testing.T) { } } -func TestFindStringSubmatchndex(t *testing.T) { +func TestFindStringSubmatchIndex(t *testing.T) { for _, test := range findTests { testFindSubmatchIndex(&test, MustCompile(test.pat).FindStringSubmatchIndex(test.text), t) } } +func TestFindReaderSubmatchIndex(t *testing.T) { + for _, test := range findTests { + testFindSubmatchIndex(&test, MustCompile(test.pat).FindReaderSubmatchIndex(strings.NewReader(test.text)), t) + } +} + // Now come the monster AllSubmatch cases. func TestFindAllSubmatch(t *testing.T) { @@ -452,7 +465,7 @@ func TestFindAllSubmatchIndex(t *testing.T) { } } -func TestFindAllStringSubmatchndex(t *testing.T) { +func TestFindAllStringSubmatchIndex(t *testing.T) { for _, test := range findTests { testFindAllSubmatchIndex(&test, MustCompile(test.pat).FindAllStringSubmatchIndex(test.text, -1), t) } |