aboutsummaryrefslogtreecommitdiff
path: root/test/map.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-10-09 11:18:32 -0700
committerRuss Cox <rsc@golang.org>2009-10-09 11:18:32 -0700
commitebd27d62fdd45d2fd84f7b6b3fa0740595ac1a04 (patch)
tree1d0d3f6fed536b018ee2610e83747f9496d082ea /test/map.go
parentf0bde7c51bf6169043bf605798116b75b85615f5 (diff)
downloadgo-ebd27d62fdd45d2fd84f7b6b3fa0740595ac1a04.tar.gz
go-ebd27d62fdd45d2fd84f7b6b3fa0740595ac1a04.zip
time tests; sort -nr times.out | sed 10q is illuminating.
cut the slowest tests down from a few seconds to under half a second. R=r DELTA=21 (6 added, 1 deleted, 14 changed) OCL=35509 CL=35519
Diffstat (limited to 'test/map.go')
-rw-r--r--test/map.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/map.go b/test/map.go
index d09734a130..4905f6e11f 100644
--- a/test/map.go
+++ b/test/map.go
@@ -11,7 +11,7 @@ import (
"strconv";
)
-const arraylen = 2; // BUG: shouldn't need this
+const count = 100;
func P(a []string) string {
s := "{";
@@ -57,7 +57,6 @@ func main() {
type M map[int] int;
mipM := make(map[int] M);
- const count = 1000;
var apT [2*count]*T;
for i := 0; i < count; i++ {
@@ -80,7 +79,7 @@ func main() {
msi[s] = i;
mss[s] = s10;
mss[s] = s10;
- as := make([]string, arraylen);
+ as := make([]string, 2);
as[0] = s10;
as[1] = s10;
mspa[s] = as;
@@ -162,7 +161,7 @@ func main() {
if mss[s] != s10 {
fmt.Printf("mss[%s] = %g\n", s, mss[s]);
}
- for j := 0; j < arraylen; j++ {
+ for j := 0; j < len(mspa[s]); j++ {
if mspa[s][j] != s10 {
fmt.Printf("mspa[%s][%d] = %s\n", s, j, mspa[s][j]);
}