Commit f977e251 authored by Rob Pike's avatar Rob Pike

add a test

fix make.bash for runtime - sysfile.6 depends on OS so simplest thing is to build just our own version

SVN=125130
parent 1f672596
......@@ -126,7 +126,7 @@ func (f *Fmt) pad(s string) {
}
}
}
f.buf = f.buf + s; // BUG: += should work
f.buf += s;
}
// format val into buf, ending at buf[i]. (printing is easier right-to-left;
......@@ -355,7 +355,7 @@ func unpack(a double) (negative bool, exp int, num double) {
// guess 10-exponent using 2-exponent, then fine tune.
var g double;
var e2 int;
e2, g = sys.frexp(a);
e2, g = sys.frexp(a); // BUG: should be able to say e2, g := sys.frexp(a);
e := int(e2 * .301029995663981);
g = a * pow10(-e);
for g < 1 {
......@@ -473,15 +473,15 @@ func (f *Fmt) G(a double) *Fmt {
// float
func (x *Fmt) f(a float) *Fmt {
return x.F(double(a));
return x.F(double(a))
}
// float
func (x *Fmt) e(a float) *Fmt {
return x.E(double(a));
return x.E(double(a))
}
// float
func (x *Fmt) g(a float) *Fmt {
return x.G(double(a));
return x.G(double(a))
}
......@@ -4,8 +4,6 @@
set -ex
for GOOS in linux darwin
do
make install
done
make clean
make install
......@@ -66,10 +66,10 @@ test0.go:49: illegal types for operand: AS
(<float32>FLOAT32)
(<int32>INT32)
test0.go:50: error in shape across assignment
test0.go:47: illegal types for operand: CALLMETH
test0.go:55: illegal types for operand: CALLMETH
(*<Point>{})
(<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
test0.go:47: illegal types for operand: AS
test0.go:54: illegal types for operand: AS
(<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
({})
BUG: known to fail incorrectly
......@@ -206,7 +206,7 @@ BUG: compilation should succeed
=========== bugs/bug043.go
bugs/bug043.go:14: error in shape across assignment
bugs/bug043.go:14: error in shape across assignment
bugs/bug043.go:17: error in shape across assignment
BUG: compilation should succeed
=========== bugs/bug044.go
......@@ -321,13 +321,8 @@ BUG: compilation should succeed
bugs/bug057.go:13: syntax error
BUG: compilation should succeed
=========== bugs/bug058.go
bugs/bug058.go:11: illegal types for operand: INDEX
(MAP[<string>*STRING]*<Box>{})
(<string>*STRING)
bugs/bug058.go:11: illegal types for operand: AS
(*<Box>{})
BUG: compilation should succeed
=========== bugs/bug059.go
BUG: crashes
=========== fixedbugs/bug000.go
......@@ -378,3 +373,5 @@ BUG: compilation should succeed
=========== fixedbugs/bug040.go
=========== fixedbugs/bug045.go
=========== fixedbugs/bug058.go
......@@ -9,7 +9,7 @@ package Main
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func Generate(ch *chan> int) {
for i := 2; ; i++ {
>ch = i; // Send 'i' to channel 'ch'.
>ch = i // Send 'i' to channel 'ch'.
}
}
......@@ -17,9 +17,9 @@ func Generate(ch *chan> int) {
// removing those divisible by 'prime'.
func Filter(in *chan< int, out *chan> int, prime int) {
for {
i := <in; // Receive value of new variable 'i' from 'in'.
i := <in // Receive value of new variable 'i' from 'in'.
if i % prime != 0 {
>out = i; // Send 'i' to channel 'out'.
>out = i // Send 'i' to channel 'out'.
}
}
}
......@@ -33,10 +33,10 @@ func Sieve() {
print "%d\n", prime;
ch1 := new(chan int);
go Filter(ch, ch1, prime);
ch = ch1;
ch = ch1
}
}
func Main() {
Sieve();
Sieve()
}
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