diff options
author | Rob Pike <r@golang.org> | 2009-08-11 13:54:47 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-08-11 13:54:47 -0700 |
commit | 84fefa79c535d19e45ba9828862892e18cd40eb7 (patch) | |
tree | cd9d6159de384b3bb7b81120bc18058fb7d76a22 /src/pkg/regexp | |
parent | 40e692180efc8fdff513ffce47f6fdb8463dc314 (diff) | |
download | golang-84fefa79c535d19e45ba9828862892e18cd40eb7.tar.gz |
make a simpler regexp implementation with fewer dependencies and put it inside testing.
remove "regexp." from regexp tests.
R=rsc
DELTA=1173 (1152 added, 1 deleted, 20 changed)
OCL=33028
CL=33037
Diffstat (limited to 'src/pkg/regexp')
-rw-r--r-- | src/pkg/regexp/all_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/pkg/regexp/all_test.go b/src/pkg/regexp/all_test.go index 72355e91b..c985dad42 100644 --- a/src/pkg/regexp/all_test.go +++ b/src/pkg/regexp/all_test.go @@ -37,18 +37,18 @@ type stringError struct { err os.Error; } var bad_re = []stringError{ - stringError{ `*`, regexp.ErrBareClosure }, - stringError{ `(abc`, regexp.ErrUnmatchedLpar }, - stringError{ `abc)`, regexp.ErrUnmatchedRpar }, - stringError{ `x[a-z`, regexp.ErrUnmatchedLbkt }, - stringError{ `abc]`, regexp.ErrUnmatchedRbkt }, - stringError{ `[z-a]`, regexp.ErrBadRange }, - stringError{ `abc\`, regexp.ErrExtraneousBackslash }, - stringError{ `a**`, regexp.ErrBadClosure }, - stringError{ `a*+`, regexp.ErrBadClosure }, - stringError{ `a??`, regexp.ErrBadClosure }, - stringError{ `*`, regexp.ErrBareClosure }, - stringError{ `\x`, regexp.ErrBadBackslash }, + stringError{ `*`, ErrBareClosure }, + stringError{ `(abc`, ErrUnmatchedLpar }, + stringError{ `abc)`, ErrUnmatchedRpar }, + stringError{ `x[a-z`, ErrUnmatchedLbkt }, + stringError{ `abc]`, ErrUnmatchedRbkt }, + stringError{ `[z-a]`, ErrBadRange }, + stringError{ `abc\`, ErrExtraneousBackslash }, + stringError{ `a**`, ErrBadClosure }, + stringError{ `a*+`, ErrBadClosure }, + stringError{ `a??`, ErrBadClosure }, + stringError{ `*`, ErrBareClosure }, + stringError{ `\x`, ErrBadBackslash }, } type vec []int; @@ -88,8 +88,8 @@ var matches = []tester { tester{ `a*(|(b))c*`, "aacc", vec{0,4, 2,2, -1,-1} }, } -func compileTest(t *testing.T, expr string, error os.Error) *regexp.Regexp { - re, err := regexp.Compile(expr); +func compileTest(t *testing.T, expr string, error os.Error) *Regexp { + re, err := Compile(expr); if err != error { t.Error("compiling `", expr, "`; unexpected error: ", err.String()); } |