1
0
mirror of https://github.com/golang/go synced 2024-11-26 13:38:20 -07:00

casify struct fields in entire tree.

TBR=r
OCL=22997
CL=22997
This commit is contained in:
Russ Cox 2009-01-16 15:28:33 -08:00
parent 06869eedf9
commit aedf121e30

View File

@ -70,12 +70,12 @@ func (t *T) Fatalf(format string, args ...) {
} }
export type Test struct { export type Test struct {
name string; Name string;
f *(*T); F *(*T);
} }
func tRunner(t *T, test *Test) { func tRunner(t *T, test *Test) {
test.f(t); test.F(t);
t.ch <- t; t.ch <- t;
} }
@ -87,18 +87,18 @@ export func Main(tests []Test) {
} }
for i := 0; i < len(tests); i++ { for i := 0; i < len(tests); i++ {
if *chatty { if *chatty {
println("=== RUN ", tests[i].name); println("=== RUN ", tests[i].Name);
} }
t := new(T); t := new(T);
t.ch = make(chan *T); t.ch = make(chan *T);
go tRunner(t, &tests[i]); go tRunner(t, &tests[i]);
<-t.ch; <-t.ch;
if t.failed { if t.failed {
println("--- FAIL:", tests[i].name); println("--- FAIL:", tests[i].Name);
print(t.errors); print(t.errors);
ok = false; ok = false;
} else if *chatty { } else if *chatty {
println("--- PASS:", tests[i].name); println("--- PASS:", tests[i].Name);
print(t.errors); print(t.errors);
} }
} }