aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Wedgwood <cw@f00f.org>2010-04-12 18:10:29 -0700
committerRuss Cox <rsc@golang.org>2010-04-12 18:10:29 -0700
commitd80c78b62f8ca71355f4b57c87791e8005033ff2 (patch)
treefd7b8ba4476603d304bfd03d7c902774d3c779d5
parent74d0302eb9c4f5fd2b771a0c1798d3ead3254826 (diff)
downloadgo-d80c78b62f8ca71355f4b57c87791e8005033ff2.tar.gz
go-d80c78b62f8ca71355f4b57c87791e8005033ff2.zip
test: minor updates to avoid bitrot
R=rsc, r CC=golang-dev https://golang.org/cl/854046
-rw-r--r--test/garbage/parser.go10
-rw-r--r--test/garbage/peano.go2
2 files changed, 6 insertions, 6 deletions
diff --git a/test/garbage/parser.go b/test/garbage/parser.go
index 115aeb695e..2485908e8d 100644
--- a/test/garbage/parser.go
+++ b/test/garbage/parser.go
@@ -18,13 +18,13 @@ import (
"time"
)
-func isGoFile(dir *os.Dir) bool {
+func isGoFile(dir *os.FileInfo) bool {
return dir.IsRegular() &&
!strings.HasPrefix(dir.Name, ".") && // ignore .files
path.Ext(dir.Name) == ".go"
}
-func isPkgFile(dir *os.Dir) bool {
+func isPkgFile(dir *os.FileInfo) bool {
return isGoFile(dir) &&
!strings.HasSuffix(dir.Name, "_test.go") // ignore test files
}
@@ -43,7 +43,7 @@ func parseDir(dirpath string) map[string]*ast.Package {
_, pkgname := path.Split(dirpath)
// filter function to select the desired .go files
- filter := func(d *os.Dir) bool {
+ filter := func(d *os.FileInfo) bool {
if isPkgFile(d) {
// Some directories contain main packages: Only accept
// files that belong to the expected package so that
@@ -94,9 +94,9 @@ func main() {
}
t1 := time.Nanoseconds()
- fmt.Printf("Alloc=%d/%d Heap=%d/%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
+ fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
st.Alloc, st.TotalAlloc,
- st.InusePages<<12, st.Sys,
+ st.Sys,
st.Mallocs, float64(st.PauseNs)/1e9,
st.NumGC, float64(st.PauseNs)/1e9/float64(st.NumGC))
diff --git a/test/garbage/peano.go b/test/garbage/peano.go
index 36ddbe8f57..b026354e8c 100644
--- a/test/garbage/peano.go
+++ b/test/garbage/peano.go
@@ -88,7 +88,7 @@ func count(x *Number) int {
func check(x *Number, expected int) {
var c = count(x)
if c != expected {
- panic("error: found ", c, "; expected ", expected, "\n")
+ panic(fmt.Sprintf("error: found %d; expected %d", c, expected))
}
}