]> Cypherpunks repositories - gostls13.git/commit
testing/quick: generate more map and slice states
authorMatt T. Proud <matt.proud@gmail.com>
Thu, 29 Oct 2015 10:14:05 +0000 (11:14 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 26 Feb 2016 20:04:04 +0000 (20:04 +0000)
commit0ccabe2e0b42a2602e0f37ce28d5368aa811f530
tree58383052537513a7d1caa66259e6fc665267bf02
parent763e8fcc8931b44db77f7bcbc7b6943a2a8fb747
testing/quick: generate more map and slice states

This change adds support in testing/quick to generate maps and slices
in additional states:

  (1.) nil maps

  (2.) nil slices

  (3.) empty slice occupancy: `len(s) == 0 && s != nil`

  (4.) partial slice occupancy: `len(s) < cap(s) && s != nil`

  (5.) full slice occupancy: `len(s) == cap(s) && s != nil`

Prior to this, only #5 was ever generated, thereby not sufficiently
exercising all of the fuzzable code path outcomes.

This change depends on https://go-review.googlesource.com/#/c/17499/.

Change-Id: I9343c475cefbd72ffc5237281826465c25872206
Reviewed-on: https://go-review.googlesource.com/16470
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/testing/quick/quick.go
src/testing/quick/quick_test.go