Commit 61a7e440 authored by Rob Pike's avatar Rob Pike

fix some tests. only 3 remain broken (complit, hilbert, initcomma).

leaving golden.out alone for now.

R=ken
DELTA=13  (0 added, 0 deleted, 13 changed)
OCL=21682
CL=21682
parent c3077f76
......@@ -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;
}
......
......@@ -13,7 +13,7 @@ type T struct {
func main() {
var ta []*T;
ta = new(*[1]*T);
ta = new([1]*T);
ta[0] = nil;
}
/*
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)) }
}
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment