summaryrefslogtreecommitdiff
path: root/src/pkg/regexp/all_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-11-23 14:06:21 -0800
committerRob Pike <r@golang.org>2009-11-23 14:06:21 -0800
commitb551d0b68a0c5e29fc930061d0a795e4df6e27ef (patch)
tree5d55bd4eb0f9a8be73e4620d90948ded8b6d9321 /src/pkg/regexp/all_test.go
parent6fb28258ee660c99bda8706db6778a964d52abac (diff)
downloadgolang-b551d0b68a0c5e29fc930061d0a795e4df6e27ef.tar.gz
fix bug in prefix code: must stop one character before any potential match of an empty string
Fixes issue 308. R=rsc CC=golang-dev http://codereview.appspot.com/157142
Diffstat (limited to 'src/pkg/regexp/all_test.go')
-rw-r--r--src/pkg/regexp/all_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/regexp/all_test.go b/src/pkg/regexp/all_test.go
index fb6f3a030..6c586ba98 100644
--- a/src/pkg/regexp/all_test.go
+++ b/src/pkg/regexp/all_test.go
@@ -95,6 +95,8 @@ var matches = []tester{
tester{`a*(|(b))c*`, "aacc", vec{0, 4, 2, 2, -1, -1}},
tester{`(.*).*`, "ab", vec{0, 2, 0, 2}},
tester{`[.]`, ".", vec{0, 1}},
+ tester{`/$`, "/abc/", vec{4, 5}},
+ tester{`/$`, "/abc", vec{}},
}
func compileTest(t *testing.T, expr string, error os.Error) *Regexp {