Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d80c78b6
Commit
d80c78b6
authored
Apr 13, 2010
by
Christopher Wedgwood
Committed by
Russ Cox
Apr 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: minor updates to avoid bitrot
R=rsc, r CC=golang-dev
https://golang.org/cl/854046
parent
74d0302e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
parser.go
test/garbage/parser.go
+5
-5
peano.go
test/garbage/peano.go
+1
-1
No files found.
test/garbage/parser.go
View file @
d80c78b6
...
...
@@ -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
))
...
...
test/garbage/peano.go
View file @
d80c78b6
...
...
@@ -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
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment