]> Cypherpunks repositories - gostls13.git/commit
encoding/pem: make TestFuzz testing/quick safe
authorMatt T. Proud <matt.proud@gmail.com>
Tue, 8 Dec 2015 12:02:17 +0000 (13:02 +0100)
committerRuss Cox <rsc@golang.org>
Tue, 8 Dec 2015 19:27:20 +0000 (19:27 +0000)
commit616e45eaa13eee9411f0528e91f46212aa58dc97
tree702c9ecb2b7f30b2ba2f0aa3a3a6b827ea9f9da6
parent1be2ddda9a372de052ba3428128085152b2e9044
encoding/pem: make TestFuzz testing/quick safe

This adapts pem.TestFuzz to sanitize the generated Block fields,
because the encoder and wireformat do not differentiate between nil
and empty slices and maps, while reflect.DeepEqual rightfully does.
In the commit mentioned below, we adapt quick.Value in
testing/quick to generate these value states, which had heretofore
been impossible with the standard library fuzz test facility.

This commit is a piecemeal extraction from ...

  https://go-review.googlesource.com/#/c/16470

..., which rsc requested to be separated from the nil slice and map
generations.

Change-Id: Iec751a2b0082af6e672a09dc9b7f4b4fb309e8a8
Reviewed-on: https://go-review.googlesource.com/17499
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/pem/pem_test.go