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
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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));
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue