mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
The prefix optimization applies only to the first iteration.
Fixes #596. R=rsc CC=golang-dev https://golang.org/cl/206101
This commit is contained in:
parent
ca075494a6
commit
7db472fd34
2 changed files with 17 additions and 6 deletions
|
|
@ -30,7 +30,6 @@ var good_re = []string{
|
|||
`[^\n]`,
|
||||
}
|
||||
|
||||
// TODO: nice to do this with a map
|
||||
type stringError struct {
|
||||
re string
|
||||
err os.Error
|
||||
|
|
@ -97,6 +96,10 @@ var matches = []tester{
|
|||
tester{`[.]`, ".", vec{0, 1}},
|
||||
tester{`/$`, "/abc/", vec{4, 5}},
|
||||
tester{`/$`, "/abc", vec{}},
|
||||
|
||||
// fixed bugs
|
||||
tester{`ab$`, "cab", vec{1, 3}},
|
||||
tester{`axxb$`, "axxcb", vec{}},
|
||||
}
|
||||
|
||||
func compileTest(t *testing.T, expr string, error os.Error) *Regexp {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue