aboutsummaryrefslogtreecommitdiff
path: root/src/testing/quick/quick_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/quick/quick_test.go')
-rw-r--r--src/testing/quick/quick_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testing/quick/quick_test.go b/src/testing/quick/quick_test.go
index 1b973027d5..c79f30ea1d 100644
--- a/src/testing/quick/quick_test.go
+++ b/src/testing/quick/quick_test.go
@@ -83,6 +83,9 @@ type TestMapAlias map[int]int
func fMapAlias(a TestMapAlias) TestMapAlias { return a }
func fPtr(a *int) *int {
+ if a == nil {
+ return nil
+ }
b := *a
return &b
}
@@ -255,3 +258,17 @@ func TestFailure(t *testing.T) {
t.Errorf("#3 Error was not a SetupError: %s", err)
}
}
+
+// The following test didn't terminate because nil pointers were not
+// generated.
+// Issue 8818.
+func TestNilPointers(t *testing.T) {
+ type Recursive struct {
+ Next *Recursive
+ }
+
+ f := func(rec Recursive) bool {
+ return true
+ }
+ Check(f, nil)
+}