]> Cypherpunks.ru repositories - gostls13.git/commitdiff
add a test
authorRob Pike <r@golang.org>
Fri, 27 Jun 2008 18:36:40 +0000 (11:36 -0700)
committerRob Pike <r@golang.org>
Fri, 27 Jun 2008 18:36:40 +0000 (11:36 -0700)
fix make.bash for runtime - sysfile.6 depends on OS so simplest thing is to build just our own version

SVN=125130

src/lib/fmt.go
src/runtime/make.bash
test/fixedbugs/bug058.go [moved from test/bugs/bug058.go with 100% similarity]
test/golden.out
test/sieve.go

index 521e8ed02c3f34df3ab9418223a1c5e73819c7b6..c12c39b267506ca522d0d82f7933980096b26085 100644 (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;
@@ -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))
 }
index cfeed307c080c27543316ebd128e13eaca73324f..8fa8691d9b4d301a95ae76814336359c2c0988ac 100644 (file)
@@ -4,8 +4,6 @@
 
 set -ex
 
-for GOOS in linux darwin
-do
-       make install
-done
+make clean
+make install
 
similarity index 100%
rename from test/bugs/bug058.go
rename to test/fixedbugs/bug058.go
index cb015a37e6d3b9c0934c58946474f42125afdd28..dac4eb310f337a1516b1112fc61d8884e463504c 100644 (file)
@@ -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
index c27519ab9d227ab0067d79b4b8ff615ad0d06091..dd23903e16ccd6ffc999d5a706fe94de5fb9a675 100644 (file)
@@ -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()
 }