summaryrefslogtreecommitdiff
path: root/src/pkg/testing/quick/quick.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
commit9aad19327eb719775a874f8f18bb15958db1d471 (patch)
treec515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/testing/quick/quick.go
parent073e240233589933c43143c997247c33206bb066 (diff)
downloadgolang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz
- replaced gofmt expression formatting algorithm with
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
Diffstat (limited to 'src/pkg/testing/quick/quick.go')
-rw-r--r--src/pkg/testing/quick/quick.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/testing/quick/quick.go b/src/pkg/testing/quick/quick.go
index 825fc12e2..8fe895ee0 100644
--- a/src/pkg/testing/quick/quick.go
+++ b/src/pkg/testing/quick/quick.go
@@ -27,7 +27,7 @@ type Generator interface {
// randFloat32 generates a random float taking the full range of a float32.
func randFloat32(rand *rand.Rand) float32 {
f := rand.Float64() * math.MaxFloat32;
- if rand.Int() & 1 == 1 {
+ if rand.Int()&1 == 1 {
f = -f
}
return float32(f);
@@ -36,7 +36,7 @@ func randFloat32(rand *rand.Rand) float32 {
// randFloat64 generates a random float taking the full range of a float64.
func randFloat64(rand *rand.Rand) float64 {
f := rand.Float64();
- if rand.Int() & 1 == 1 {
+ if rand.Int()&1 == 1 {
f = -f
}
return f;
@@ -59,7 +59,7 @@ func Value(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool) {
switch concrete := t.(type) {
case *reflect.BoolType:
- return reflect.NewValue(rand.Int() & 1 == 0), true
+ return reflect.NewValue(rand.Int()&1 == 0), true
case *reflect.Float32Type:
return reflect.NewValue(randFloat32(rand)), true
case *reflect.Float64Type:
@@ -262,7 +262,7 @@ func Check(function interface{}, config *Config) (err os.Error) {
}
if !f.Call(arguments)[0].(*reflect.BoolValue).Get() {
- err = &CheckError{i+1, toInterfaces(arguments)};
+ err = &CheckError{i + 1, toInterfaces(arguments)};
return;
}
}
@@ -309,7 +309,7 @@ func CheckEqual(f, g interface{}, config *Config) (err os.Error) {
yOut := toInterfaces(y.Call(arguments));
if !reflect.DeepEqual(xOut, yOut) {
- err = &CheckEqualError{CheckError{i+1, toInterfaces(arguments)}, xOut, yOut};
+ err = &CheckEqualError{CheckError{i + 1, toInterfaces(arguments)}, xOut, yOut};
return;
}
}