Example #1
0
func testMode() (environ.TestEnv, func()) {
	prevWorld, prevComp := World, compression
	tw := environ.NewTest(3)
	World, compression = tw, gzip.NoCompression
	return tw, func() {
		World, compression = prevWorld, prevComp
	}
}
Example #2
0
func testMode(r environ.TestRun) (environ.TestEnv, func()) {
	p1, p2, p3, p4 := World, tarball.World, vcs.World, gotool.World
	tw := environ.NewTest(3)
	tw.SetRun(r)
	World, tarball.World, vcs.World, gotool.World = tw, tw, tw, tw
	return tw, func() {
		World, tarball.World, vcs.World, gotool.World = p1, p2, p3, p4
	}
}