mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
files that are okay from the last gofmt round
R=gri http://go/go-review/1015011
This commit is contained in:
parent
58ee1f5d54
commit
d2829faa7c
16 changed files with 53 additions and 68 deletions
|
|
@ -190,5 +190,5 @@ func TestNRDiv(t *testing.T) {
|
|||
idiv(t, 7484890589595, 7484890589594);
|
||||
div(t, Fact(100), Fact(91));
|
||||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,18 +241,14 @@ func TestMap(t *testing.T) {
|
|||
// Run a couple of awful growth/shrinkage tests
|
||||
a := tenRunes('a');
|
||||
// 1. Grow. This triggers two reallocations in Map.
|
||||
maxRune := func(rune int) int {
|
||||
return unicode.MaxRune;
|
||||
};
|
||||
maxRune := func(rune int) int { return unicode.MaxRune };
|
||||
m := Map(maxRune, Bytes(a));
|
||||
expect := tenRunes(unicode.MaxRune);
|
||||
if string(m) != expect {
|
||||
t.Errorf("growing: expected %q got %q", expect, m);
|
||||
}
|
||||
// 2. Shrink
|
||||
minRune := func(rune int) int {
|
||||
return 'a';
|
||||
};
|
||||
minRune := func(rune int) int { return 'a' };
|
||||
m = Map(minRune, Bytes(tenRunes(unicode.MaxRune)));
|
||||
expect = a;
|
||||
if string(m) != expect {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
type ProcessExited struct {}
|
||||
type ProcessExited struct{}
|
||||
|
||||
func (p ProcessExited) String() string {
|
||||
return "process exited";
|
||||
|
|
@ -852,12 +852,8 @@ func (t *thread) stepAsync(ready chan os.Error) os.Error {
|
|||
return err;
|
||||
}
|
||||
t.setState(singleStepping);
|
||||
t.onStop(func() {
|
||||
ready <- nil;
|
||||
},
|
||||
func(err os.Error) {
|
||||
ready <- err;
|
||||
});
|
||||
t.onStop(func() { ready <- nil },
|
||||
func(err os.Error) { ready <- err });
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
@ -1100,9 +1096,7 @@ func (p *process) WaitStop() os.Error {
|
|||
}
|
||||
p.transitionHandlers.Push(h);
|
||||
};
|
||||
h.onErr = func(err os.Error) {
|
||||
ready <- err;
|
||||
};
|
||||
h.onErr = func(err os.Error) { ready <- err };
|
||||
p.transitionHandlers.Push(h);
|
||||
return nil;
|
||||
});
|
||||
|
|
@ -1114,9 +1108,7 @@ func (p *process) WaitStop() os.Error {
|
|||
}
|
||||
|
||||
func (p *process) Stop() os.Error {
|
||||
err := p.do(func() os.Error {
|
||||
return p.stopAsync();
|
||||
});
|
||||
err := p.do(func() os.Error { return p.stopAsync() });
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,13 +156,13 @@ var tree = &Node{
|
|||
&Node{"u", nil, 0},
|
||||
&Node{"v", nil, 0},
|
||||
},
|
||||
0
|
||||
}
|
||||
0,
|
||||
},
|
||||
0
|
||||
}
|
||||
},
|
||||
0
|
||||
0,
|
||||
},
|
||||
},
|
||||
0,
|
||||
}
|
||||
|
||||
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) {
|
||||
walkTree(n, "", func(path string, n *Node) {
|
||||
n.mark++;
|
||||
});
|
||||
walkTree(n, "", func(path string, n *Node) { n.mark++ });
|
||||
}
|
||||
|
||||
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 {
|
||||
mark(d.Name);
|
||||
|
|
|
|||
|
|
@ -59,9 +59,7 @@ func plus1(v interface{}) string {
|
|||
}
|
||||
|
||||
func writer(f func(interface{}) string) (func(io.Writer, interface{}, string)) {
|
||||
return func(w io.Writer, v interface{}, format string) {
|
||||
io.WriteString(w, f(v));
|
||||
};
|
||||
return func(w io.Writer, v interface{}, format string) { io.WriteString(w, f(v)) };
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,8 @@ var inTest = []T{
|
|||
}
|
||||
|
||||
var outTest = []T{ // not really worth being thorough
|
||||
T{0x20, "Telugu"}}
|
||||
T{0x20, "Telugu"},
|
||||
}
|
||||
|
||||
var inCategoryTest = []T{
|
||||
T{0x0081, "Cc"},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue