diff options
| author | Rob Pike <r@golang.org> | 2009-01-09 13:42:46 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-01-09 13:42:46 -0800 |
| commit | 55a86a6a5ca0df4645eef264749af0c330629fb1 (patch) | |
| tree | 3ebfa1a54e00ad1ed251c95c02b24b370a25b64d /src/lib/testing.go | |
| parent | 725dda33073ae0af232272d86cbb6ca1029feeb3 (diff) | |
| download | golang-55a86a6a5ca0df4645eef264749af0c330629fb1.tar.gz | |
simplify flag interface. no more BVal etc. you just get a pointer.
fixed everything except the tutorial.
R=rsc
DELTA=404 (94 added, 139 deleted, 171 changed)
OCL=22414
CL=22422
Diffstat (limited to 'src/lib/testing.go')
| -rw-r--r-- | src/lib/testing.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/testing.go b/src/lib/testing.go index 6d3275f00..12512f5d2 100644 --- a/src/lib/testing.go +++ b/src/lib/testing.go @@ -9,10 +9,7 @@ import ( "flag"; ) -var chatty bool; -func init() { - flag.Bool("chatty", false, &chatty, "chatty"); -} +var chatty = flag.Bool("chatty", false, "chatty") // Insert tabs after newlines - but not the last one func Tabify(s string) string { @@ -89,7 +86,7 @@ export func Main(tests []Test) { println("testing: warning: no tests to run"); } for i := 0; i < len(tests); i++ { - if chatty { + if *chatty { println("=== RUN ", tests[i].name); } t := new(T); @@ -100,7 +97,7 @@ export func Main(tests []Test) { println("--- FAIL:", tests[i].name); print(t.errors); ok = false; - } else if chatty { + } else if *chatty { println("--- PASS:", tests[i].name); print(t.errors); } |
