Commit e56dc0ad authored by Russ Cox's avatar Russ Cox

cmd/go: every test imports regexp

This fixes the bug Rob ran into when editing package bytes.
Regexp imports regexp/syntax, which imports bytes, and
regexp/syntax was not being properly recompiled during a
test of a change to package bytes.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5555065
parent c4b16a38
......@@ -406,6 +406,18 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
if pxtest != nil {
pmain.imports = append(pmain.imports, pxtest)
}
// The generated main also imports testing and regexp.
ptesting, err := loadPackage("testing")
if err != nil {
return nil, nil, nil, err
}
pregexp, err := loadPackage("regexp")
if err != nil {
return nil, nil, nil, err
}
pmain.imports = append(pmain.imports, ptesting, pregexp)
a := b.action(modeBuild, modeBuild, pmain)
a.objdir = testDir + string(filepath.Separator)
a.objpkg = filepath.Join(testDir, "main.a")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment