mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded in testing, delete it by passing the one function we need from the package main file created by gotest. R=rsc CC=golang-dev https://golang.org/cl/2761043
This commit is contained in:
parent
1f4d54ea01
commit
4e9cc085d2
10 changed files with 26 additions and 917 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue