aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/regexp/find_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/regexp/find_test.go')
-rw-r--r--libgo/go/regexp/find_test.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/libgo/go/regexp/find_test.go b/libgo/go/regexp/find_test.go
index 1690711..83b249e 100644
--- a/libgo/go/regexp/find_test.go
+++ b/libgo/go/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)
}