mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
fix bug in prefix code: must stop one character before any potential match of an empty string
Fixes #308. R=rsc CC=golang-dev https://golang.org/cl/157142
This commit is contained in:
parent
b050a1b223
commit
3b7f552fbb
2 changed files with 8 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue