summaryrefslogtreecommitdiff
path: root/src/pkg/regexp/all_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-08-05 14:40:34 -0700
committerRob Pike <r@golang.org>2009-08-05 14:40:34 -0700
commit79475d55878ee129a94cd669a43c0c0df84969df (patch)
treefe22e047d9f56c562265aa7c3a539806414386ce /src/pkg/regexp/all_test.go
parentf878417eaeb42a8919a9035eb6cae37b4797e43c (diff)
downloadgolang-79475d55878ee129a94cd669a43c0c0df84969df.tar.gz
special case: recognize '[^\n]' and make it as fast as '.'
R=rsc DELTA=25 (23 added, 1 deleted, 1 changed) OCL=32793 CL=32799
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 23c22003e..0d16b24e3 100644
--- a/src/pkg/regexp/all_test.go
+++ b/src/pkg/regexp/all_test.go
@@ -27,6 +27,7 @@ var good_re = []string{
`[]`,
`[abc]`,
`[^1234]`,
+ `[^\n]`,
}
// TODO: nice to do this with a map
@@ -72,6 +73,7 @@ var matches = []tester {
tester{ `[a-z]+`, "abcd", vec{0,4} },
tester{ `[^a-z]+`, "ab1234cd", vec{2,6} },
tester{ `[a\-\]z]+`, "az]-bcz", vec{0,4} },
+ tester{ `[^\n]+`, "abcd\n", vec{0,4} },
tester{ `[日本語]+`, "日本語日本語", vec{0,18} },
tester{ `()`, "", vec{0,0, 0,0} },
tester{ `(a)`, "a", vec{0,1, 0,1} },