diff options
| author | Russ Cox <rsc@golang.org> | 2016-05-06 15:28:19 +0000 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2016-05-06 18:25:28 +0000 |
| commit | 670a5cda2048af8d83958af0f4b2fda8f7b4ea72 (patch) | |
| tree | 981ba3b18d155520135d23d99b007232b7220551 /src/testing/quick/quick_test.go | |
| parent | 131231b8db26b38c9c2fdc52fb788241f5c2de51 (diff) | |
| download | go-670a5cda2048af8d83958af0f4b2fda8f7b4ea72.tar.xz | |
Revert "testing/quick: generate more map and slice states"
This reverts commit 0ccabe2e0b42a2602e0f37ce28d5368aa811f530.
Change-Id: Ib1c230fb6801c0ee26f4a352b0c1130fa240a76a
Reviewed-on: https://go-review.googlesource.com/22860
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/testing/quick/quick_test.go')
| -rw-r--r-- | src/testing/quick/quick_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testing/quick/quick_test.go b/src/testing/quick/quick_test.go index 018ece2a52..fe443592f8 100644 --- a/src/testing/quick/quick_test.go +++ b/src/testing/quick/quick_test.go @@ -290,3 +290,20 @@ func TestMutuallyRecursive(t *testing.T) { f := func(a A) bool { return true } Check(f, nil) } + +// Some serialization formats (e.g. encoding/pem) cannot distinguish +// between a nil and an empty map or slice, so avoid generating the +// zero value for these. +func TestNonZeroSliceAndMap(t *testing.T) { + type Q struct { + M map[int]int + S []int + } + f := func(q Q) bool { + return q.M != nil && q.S != nil + } + err := Check(f, nil) + if err != nil { + t.Fatal(err) + } +} |
