summaryrefslogtreecommitdiff
path: root/libgo/go/regexp/syntax/prog_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/regexp/syntax/prog_test.go')
-rw-r--r--libgo/go/regexp/syntax/prog_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/libgo/go/regexp/syntax/prog_test.go b/libgo/go/regexp/syntax/prog_test.go
index 50bfa3d4bef..5603aea2289 100644
--- a/libgo/go/regexp/syntax/prog_test.go
+++ b/libgo/go/regexp/syntax/prog_test.go
@@ -89,6 +89,21 @@ var compileTests = []struct {
2 anynotnl -> 3
3 match
`},
+ {"(?:|a)+", ` 0 fail
+ 1 nop -> 4
+ 2 rune1 "a" -> 4
+ 3* alt -> 1, 2
+ 4 alt -> 3, 5
+ 5 match
+`},
+ {"(?:|a)*", ` 0 fail
+ 1 nop -> 4
+ 2 rune1 "a" -> 4
+ 3 alt -> 1, 2
+ 4 alt -> 3, 6
+ 5* alt -> 3, 6
+ 6 match
+`},
}
func TestCompile(t *testing.T) {