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
This commit is contained in:
Rob Pike 2008-06-27 11:36:40 -07:00
parent 1f672596c5
commit f977e251fa
5 changed files with 19 additions and 24 deletions

View file

@ -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; // 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. // guess 10-exponent using 2-exponent, then fine tune.
var g double; var g double;
var e2 int; 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); e := int(e2 * .301029995663981);
g = a * pow10(-e); g = a * pow10(-e);
for g < 1 { for g < 1 {
@ -473,15 +473,15 @@ func (f *Fmt) G(a double) *Fmt {
// float // float
func (x *Fmt) f(a float) *Fmt { func (x *Fmt) f(a float) *Fmt {
return x.F(double(a)); return x.F(double(a))
} }
// float // float
func (x *Fmt) e(a float) *Fmt { func (x *Fmt) e(a float) *Fmt {
return x.E(double(a)); return x.E(double(a))
} }
// float // float
func (x *Fmt) g(a float) *Fmt { func (x *Fmt) g(a float) *Fmt {
return x.G(double(a)); return x.G(double(a))
} }

View file

@ -4,8 +4,6 @@
set -ex set -ex
for GOOS in linux darwin make clean
do make install
make install
done

View file

@ -66,10 +66,10 @@ test0.go:49: illegal types for operand: AS
(<float32>FLOAT32) (<float32>FLOAT32)
(<int32>INT32) (<int32>INT32)
test0.go:50: error in shape across assignment 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>{})
(<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};}) (<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({},{}){};}) (<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
({}) ({})
BUG: known to fail incorrectly BUG: known to fail incorrectly
@ -206,7 +206,7 @@ BUG: compilation should succeed
=========== bugs/bug043.go =========== bugs/bug043.go
bugs/bug043.go:14: error in shape across assignment 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 BUG: compilation should succeed
=========== bugs/bug044.go =========== bugs/bug044.go
@ -321,13 +321,8 @@ BUG: compilation should succeed
bugs/bug057.go:13: syntax error bugs/bug057.go:13: syntax error
BUG: compilation should succeed BUG: compilation should succeed
=========== bugs/bug058.go =========== bugs/bug059.go
bugs/bug058.go:11: illegal types for operand: INDEX BUG: crashes
(MAP[<string>*STRING]*<Box>{})
(<string>*STRING)
bugs/bug058.go:11: illegal types for operand: AS
(*<Box>{})
BUG: compilation should succeed
=========== fixedbugs/bug000.go =========== fixedbugs/bug000.go
@ -378,3 +373,5 @@ BUG: compilation should succeed
=========== fixedbugs/bug040.go =========== fixedbugs/bug040.go
=========== fixedbugs/bug045.go =========== fixedbugs/bug045.go
=========== fixedbugs/bug058.go

View file

@ -9,7 +9,7 @@ package Main
// Send the sequence 2, 3, 4, ... to channel 'ch'. // Send the sequence 2, 3, 4, ... to channel 'ch'.
func Generate(ch *chan> int) { func Generate(ch *chan> int) {
for i := 2; ; i++ { 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'. // removing those divisible by 'prime'.
func Filter(in *chan< int, out *chan> int, prime int) { func Filter(in *chan< int, out *chan> int, prime int) {
for { 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 { 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; print "%d\n", prime;
ch1 := new(chan int); ch1 := new(chan int);
go Filter(ch, ch1, prime); go Filter(ch, ch1, prime);
ch = ch1; ch = ch1
} }
} }
func Main() { func Main() {
Sieve(); Sieve()
} }