]> Cypherpunks repositories - gostls13.git/commitdiff
fix some tests. only 3 remain broken (complit, hilbert, initcomma).
authorRob Pike <r@golang.org>
Sat, 20 Dec 2008 21:38:29 +0000 (13:38 -0800)
committerRob Pike <r@golang.org>
Sat, 20 Dec 2008 21:38:29 +0000 (13:38 -0800)
leaving golden.out alone for now.

R=ken
DELTA=13  (0 added, 0 deleted, 13 changed)
OCL=21682
CL=21682

test/fixedbugs/bug027.go
test/fixedbugs/bug045.go
test/fixedbugs/bug054.go
test/fixedbugs/bug059.go
test/initcomma.go
test/ken/array.go
test/ken/rob2.go
test/ken/string.go
test/vectors.go

index 95bc06412730c33febdce95f594712355a6092ea..d15da9cd421a9088af2fb765c04e0081738ab661 100644 (file)
@@ -17,7 +17,7 @@ type Vector struct {
 func New() *Vector {
        v := new(*Vector);
        v.nelem = 0;
-       v.elem = new(*[10]Element);
+       v.elem = new([10]Element);
        return v;
 }
 
index 9e94f44739b6007dc07c282b13817ddfafcfa604..d8a712c6dab0cf47f65bd25b4684850220185abf 100644 (file)
@@ -13,7 +13,7 @@ type T struct {
 func main() {
        var ta []*T;
 
-       ta = new(*[1]*T);
+       ta = new([1]*T);
        ta[0] = nil;
 }
 /*
index f4d7c27faa7aa8a633daaf221930e85d37f9c41d..2caff0f0ca074c01f2c774f331eaa5e5da063a43 100644 (file)
@@ -31,7 +31,7 @@ func (s *TStruct) field(i int) *TStruct {
 
 func main() {
        v := new(*Vector);
-       v.elem = new(*[10]Element);
+       v.elem = new([10]Element);
        t := new(*TStruct);
        t.name = "hi";
        v.elem[0] = t;
index 55c05f6806dedfafae8421379e4b617792d50623..5a29ed1f09354d2825ebf857c474a382f2a9f2a0 100644 (file)
@@ -20,7 +20,7 @@ func P(a []string) string {
 
 func main() {
        m := new(map[string] []string);
-       as := new(*[2]string);
+       as := new([2]string);
        as[0] = "0";
        as[1] = "1";
        m["0"] = as;
index d86ddbac43bb432eab61032f214407086474d6b0..da127d4b5fd37ab390344eb1b423d27c70c7bd0f 100644 (file)
@@ -13,5 +13,5 @@ var c = []int { 1 }
 func main() {
        if len(a) != 2 { panicln("len a", len(a)) }
        if len(b) != 5 { panicln("len b", len(b)) }
-       if len(c) != 1 { panicln("len a", len(a)) }
+       if len(c) != 1 { panicln("len a", len(c)) }
 }
index 2027a31fffb7d4f599f3bcc0dfed179005c3ed4b..29b456dd9ac4bff30c5419d9d7d43c918ce6f750 100644 (file)
@@ -96,10 +96,10 @@ func
 testpdpf1()
 {
        a := new(*[40]int);
-       setpd(a);
-       res(sumpd(a), 0, 40);
+       setpd(*a);
+       res(sumpd(*a), 0, 40);
 
-       b := a[5:30];
+       b := (*a)[5:30];
        res(sumpd(b), 5, 30);
 }
 
index 9cb2ff3ddabfe44614d09e27950630dbd11c7d82..6e14bdae39e5591fd11b9e565391ad5cf285fcff 100644 (file)
@@ -139,7 +139,7 @@ func Get() int
                c = peekc;
                peekc = -1;
        } else {
-               c = convert(int, input[inputindex]);
+               c = int(input[inputindex]);
                inputindex++;
                if c == '\n' {
                        lineno = lineno + 1;
@@ -175,7 +175,7 @@ func NextToken()
                break;
        default:
                for i = 0; i < 100 - 1; {       // sizeof tokenbuf - 1
-                       tokenbuf[i] = convert(byte, c);
+                       tokenbuf[i] = byte(c);
                        i = i + 1;
                        c = Get();
                        if c == EOF {
@@ -252,7 +252,7 @@ func atoi() int     // BUG: uses tokenbuf; should take argument
 {
        var v int = 0;
        for i := 0; i < tokenlen && '0' <= tokenbuf[i] && tokenbuf[i] <= '9'; i = i + 1 {
-               v = 10 * v + convert(int, tokenbuf[i] - '0');
+               v = 10 * v + int(tokenbuf[i] - '0');
        }
        return v;
 }
index 7e3aa902b02ab71314e599cd7159a72853006d9d..7bd402e1f0f59d4d6a9af44597939ef47eeed0e9 100644 (file)
@@ -96,7 +96,7 @@ main()
        z2[0] = 'a';
        z2[1] = 'b';
        z2[2] = 'c';
-       c = string(z2);
+       c = string(*z2);
        if c != "abc" {
                panic("create array pointer ", c);
        }
index abc59732e42e60975d719e53b75e20cd573c6971..921bc28c2bb2cdc1a83e4e4394aa3c9401da3f92 100644 (file)
@@ -43,7 +43,7 @@ func test1() {
        }
 
        for i := 0; i < v.Len(); i++ {
-               x := convert(*S, v.At(i));
+               x := v.At(i).(*S);
                if x.val != v.Len() - i - 1 {
                        panic("expected ", i, ", found ", x.val, "\n");
                }