diff options
Diffstat (limited to 'src/pkg/testing/quick')
| -rw-r--r-- | src/pkg/testing/quick/quick.go | 13 | ||||
| -rw-r--r-- | src/pkg/testing/quick/quick_test.go | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/pkg/testing/quick/quick.go b/src/pkg/testing/quick/quick.go index 9ec1925de3..9e6b84bc29 100644 --- a/src/pkg/testing/quick/quick.go +++ b/src/pkg/testing/quick/quick.go @@ -9,7 +9,6 @@ import ( "flag" "fmt" "math" - "os" "rand" "reflect" "strings" @@ -191,7 +190,7 @@ func (c *Config) getMaxCount() (maxCount int) { // used, independent of the functions being tested. type SetupError string -func (s SetupError) String() string { return string(s) } +func (s SetupError) Error() string { return string(s) } // A CheckError is the result of Check finding an error. type CheckError struct { @@ -199,7 +198,7 @@ type CheckError struct { In []interface{} } -func (s *CheckError) String() string { +func (s *CheckError) Error() string { return fmt.Sprintf("#%d: failed on input %s", s.Count, toString(s.In)) } @@ -210,7 +209,7 @@ type CheckEqualError struct { Out2 []interface{} } -func (s *CheckEqualError) String() string { +func (s *CheckEqualError) Error() string { return fmt.Sprintf("#%d: failed on input %s. Output 1: %s. Output 2: %s", s.Count, toString(s.In), toString(s.Out1), toString(s.Out2)) } @@ -229,7 +228,7 @@ func (s *CheckEqualError) String() string { // t.Error(err) // } // } -func Check(function interface{}, config *Config) (err os.Error) { +func Check(function interface{}, config *Config) (err error) { if config == nil { config = &defaultConfig } @@ -272,7 +271,7 @@ func Check(function interface{}, config *Config) (err os.Error) { // It calls f and g repeatedly with arbitrary values for each argument. // If f and g return different answers, CheckEqual returns a *CheckEqualError // describing the input and the outputs. -func CheckEqual(f, g interface{}, config *Config) (err os.Error) { +func CheckEqual(f, g interface{}, config *Config) (err error) { if config == nil { config = &defaultConfig } @@ -317,7 +316,7 @@ func CheckEqual(f, g interface{}, config *Config) (err os.Error) { // arbitraryValues writes Values to args such that args contains Values // suitable for calling f. -func arbitraryValues(args []reflect.Value, f reflect.Type, config *Config, rand *rand.Rand) (err os.Error) { +func arbitraryValues(args []reflect.Value, f reflect.Type, config *Config, rand *rand.Rand) (err error) { if config.Values != nil { config.Values(args, rand) return diff --git a/src/pkg/testing/quick/quick_test.go b/src/pkg/testing/quick/quick_test.go index f2618c3c25..e9ff1aa449 100644 --- a/src/pkg/testing/quick/quick_test.go +++ b/src/pkg/testing/quick/quick_test.go @@ -8,7 +8,6 @@ import ( "rand" "reflect" "testing" - "os" ) func fBool(a bool) bool { return a } @@ -63,7 +62,7 @@ func fIntptr(a *int) *int { return &b } -func reportError(property string, err os.Error, t *testing.T) { +func reportError(property string, err error, t *testing.T) { if err != nil { t.Errorf("%s: %s", property, err) } |
