From c072558b90f1bbedc2022b0f30c8b1ac4712538e Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Fri, 18 Feb 2011 09:50:58 +0100 Subject: Imported Upstream version 2011.02.15 --- src/pkg/regexp/find_test.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/pkg/regexp/find_test.go') 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) } -- cgit v1.2.3