aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/testing/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/testing/testing.go')
-rw-r--r--src/pkg/testing/testing.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go
index a3a7e5994d..b01f6336fc 100644
--- a/src/pkg/testing/testing.go
+++ b/src/pkg/testing/testing.go
@@ -135,19 +135,19 @@ func tRunner(t *T, test *Test) {
// An internal function but exported because it is cross-package; part of the implementation
// of gotest.
-func Main(tests []Test) {
+func Main(matchString func(pat, str string) (bool, os.Error), tests []Test) {
flag.Parse()
ok := true
if len(tests) == 0 {
println("testing: warning: no tests to run")
}
- re, err := CompileRegexp(*match)
- if err != "" {
- println("invalid regexp for -match:", err)
- os.Exit(1)
- }
for i := 0; i < len(tests); i++ {
- if !re.MatchString(tests[i].Name) {
+ matched, err := matchString(*match, tests[i].Name)
+ if err != nil {
+ println("invalid regexp for -match:", err)
+ os.Exit(1)
+ }
+ if !matched {
continue
}
if *chatty {