go/src/testing
Håvard Haugen 74245b0353 testing/quick: terminate for arbitrary recursive types
Recursive types R containing slices of R's did not terminate despite the
effort in CL 10821.

For recursive types there was a competition between slice expansion by a
factor 'complexSize', and termination with probability '1/complexSize'
which lead to stack overflow as soon as a recursive struct had slices
pointing to its own type.

Fix this by shrinking the size hint as a function of recursion depth.
This has the dual effect of reducing the number of elements generated
per slice and also increasing the probability for termination.

Fixes #11148.

Change-Id: Ib61155b4f2e2de3873d508d63a1f4be759426d67
Reviewed-on: https://go-review.googlesource.com/13830
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 19:23:37 +00:00
..
iotest testing/iotest: fix copy/paste error in comment 2014-12-29 19:05:37 +00:00
quick testing/quick: terminate for arbitrary recursive types 2015-08-29 19:23:37 +00:00
allocs.go
allocs_test.go runtime: account for tiny allocs, for testing.AllocsPerRun 2014-09-17 14:49:32 -04:00
benchmark.go testing: pad benchmark names to align results 2015-02-07 21:52:25 +00:00
benchmark_test.go
cover.go
example.go testing: make the output of -v more uniform and aligned when using fixed-width fonts 2015-05-08 18:38:25 +00:00
export_test.go
testing.go runtime/trace: add new package 2015-07-22 15:47:16 +00:00
testing_test.go cmd/go, testing: add TestMain support 2014-09-19 13:51:06 -04:00