files that are okay from the last gofmt round

R=gri
http://go/go-review/1015011
This commit is contained in:
Russ Cox 2009-10-27 22:47:54 -07:00
parent 58ee1f5d54
commit d2829faa7c
16 changed files with 53 additions and 68 deletions

View file

@ -190,5 +190,5 @@ func TestNRDiv(t *testing.T) {
idiv(t, 7484890589595, 7484890589594); idiv(t, 7484890589595, 7484890589594);
div(t, Fact(100), Fact(91)); div(t, Fact(100), Fact(91));
div(t, Fact(1000), Fact(991)); div(t, Fact(1000), Fact(991));
//div(t, Fact(10000), Fact(9991)); // takes too long - disabled for now //div(t, Fact(10000), Fact(9991)); // takes too long - disabled for now
} }

View file

@ -241,18 +241,14 @@ func TestMap(t *testing.T) {
// Run a couple of awful growth/shrinkage tests // Run a couple of awful growth/shrinkage tests
a := tenRunes('a'); a := tenRunes('a');
// 1. Grow. This triggers two reallocations in Map. // 1. Grow. This triggers two reallocations in Map.
maxRune := func(rune int) int { maxRune := func(rune int) int { return unicode.MaxRune };
return unicode.MaxRune;
};
m := Map(maxRune, Bytes(a)); m := Map(maxRune, Bytes(a));
expect := tenRunes(unicode.MaxRune); expect := tenRunes(unicode.MaxRune);
if string(m) != expect { if string(m) != expect {
t.Errorf("growing: expected %q got %q", expect, m); t.Errorf("growing: expected %q got %q", expect, m);
} }
// 2. Shrink // 2. Shrink
minRune := func(rune int) int { minRune := func(rune int) int { return 'a' };
return 'a';
};
m = Map(minRune, Bytes(tenRunes(unicode.MaxRune))); m = Map(minRune, Bytes(tenRunes(unicode.MaxRune)));
expect = a; expect = a;
if string(m) != expect { if string(m) != expect {

View file

@ -220,7 +220,7 @@ func (e *newThreadError) String() string {
return fmt.Sprintf("newThread wait wanted pid %v and signal %v, got %v and %v", e.Pid, e.StopSignal(), e.wantPid, e.wantSig); return fmt.Sprintf("newThread wait wanted pid %v and signal %v, got %v and %v", e.Pid, e.StopSignal(), e.wantPid, e.wantSig);
} }
type ProcessExited struct {} type ProcessExited struct{}
func (p ProcessExited) String() string { func (p ProcessExited) String() string {
return "process exited"; return "process exited";
@ -852,12 +852,8 @@ func (t *thread) stepAsync(ready chan os.Error) os.Error {
return err; return err;
} }
t.setState(singleStepping); t.setState(singleStepping);
t.onStop(func() { t.onStop(func() { ready <- nil },
ready <- nil; func(err os.Error) { ready <- err });
},
func(err os.Error) {
ready <- err;
});
return nil; return nil;
} }
@ -1100,9 +1096,7 @@ func (p *process) WaitStop() os.Error {
} }
p.transitionHandlers.Push(h); p.transitionHandlers.Push(h);
}; };
h.onErr = func(err os.Error) { h.onErr = func(err os.Error) { ready <- err };
ready <- err;
};
p.transitionHandlers.Push(h); p.transitionHandlers.Push(h);
return nil; return nil;
}); });
@ -1114,9 +1108,7 @@ func (p *process) WaitStop() os.Error {
} }
func (p *process) Stop() os.Error { func (p *process) Stop() os.Error {
err := p.do(func() os.Error { err := p.do(func() os.Error { return p.stopAsync() });
return p.stopAsync();
});
if err != nil { if err != nil {
return err; return err;
} }

View file

@ -156,13 +156,13 @@ var tree = &Node{
&Node{"u", nil, 0}, &Node{"u", nil, 0},
&Node{"v", nil, 0}, &Node{"v", nil, 0},
}, },
0 0,
}
}, },
0
}
}, },
0 0,
},
},
0,
} }
func walkTree(n *Node, path string, f func(path string, n *Node)) { func walkTree(n *Node, path string, f func(path string, n *Node)) {
@ -187,9 +187,7 @@ func makeTree(t *testing.T) {
} }
func markTree(n *Node) { func markTree(n *Node) {
walkTree(n, "", func(path string, n *Node) { walkTree(n, "", func(path string, n *Node) { n.mark++ });
n.mark++;
});
} }
func checkMarks(t *testing.T) { func checkMarks(t *testing.T) {
@ -210,7 +208,7 @@ func mark(name string) {
}); });
} }
type TestVisitor struct {} type TestVisitor struct{}
func (v *TestVisitor) VisitDir(path string, d *os.Dir) bool { func (v *TestVisitor) VisitDir(path string, d *os.Dir) bool {
mark(d.Name); mark(d.Name);

View file

@ -59,9 +59,7 @@ func plus1(v interface{}) string {
} }
func writer(f func(interface{}) string) (func(io.Writer, interface{}, string)) { func writer(f func(interface{}) string) (func(io.Writer, interface{}, string)) {
return func(w io.Writer, v interface{}, format string) { return func(w io.Writer, v interface{}, format string) { io.WriteString(w, f(v)) };
io.WriteString(w, f(v));
};
} }

View file

@ -98,7 +98,8 @@ var inTest = []T{
} }
var outTest = []T{ // not really worth being thorough var outTest = []T{ // not really worth being thorough
T{0x20, "Telugu"}} T{0x20, "Telugu"},
}
var inCategoryTest = []T{ var inCategoryTest = []T{
T{0x0081, "Cc"}, T{0x0081, "Cc"},