diff options
| author | Matt T. Proud <matt.proud@gmail.com> | 2015-06-20 06:29:18 +0200 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-06-26 18:03:32 +0000 |
| commit | e6ad56c711f00ee15d2c42ff64849542e19eca8a (patch) | |
| tree | 8c9d27310a41c0122785ab57480380a4eb67e56b /src/testing/quick/quick.go | |
| parent | fe15da62f778d0db62104ed8c8a7b31a150f7753 (diff) | |
| download | go-e6ad56c711f00ee15d2c42ff64849542e19eca8a.tar.xz | |
testing/quick: improve function signature error.
This commit fixes a cosmetic defect whereby quick.Check reports that
the provided function returns too many values when it may, in fact,
return too few:
func f() {}
func TestFoo(t *testing.T) {
if err := quick.Check(f, nil); err != nil {
t.Fatal(err)
}
}
// yields
// $ go test -v foo_test.go
// === RUN TestFoo
// --- FAIL: TestFoo (0.00s)
// foo_test.go:76: function returns more than one value.
Change-Id: Ia209ff5b57375b30f8db425454e80798908e8ff4
Reviewed-on: https://go-review.googlesource.com/11281
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/testing/quick/quick.go')
| -rw-r--r-- | src/testing/quick/quick.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testing/quick/quick.go b/src/testing/quick/quick.go index 0e36810eb6..13c56cdf48 100644 --- a/src/testing/quick/quick.go +++ b/src/testing/quick/quick.go @@ -249,7 +249,7 @@ func Check(f interface{}, config *Config) (err error) { } if fType.NumOut() != 1 { - err = SetupError("function returns more than one value.") + err = SetupError("function does not return one value") return } if fType.Out(0).Kind() != reflect.Bool { |
