Skip to content

Commit

Permalink
Add an implementation warning to Shrink (addresses #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
untoldwind committed Jun 24, 2016
1 parent d466d84 commit 715b638
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shrink.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import (
"reflect"
)

// Shrink is a stream of shrinked down values
// Once the result of a shrink is false, it is considered to be exhausted
// Shrink is a stream of shrinked down values.
// Once the result of a shrink is false, it is considered to be exhausted.
// Important notes for implementors:
// * Ensure that the returned stream is finite, even though shrinking will
// eventually be aborted, infinite streams may result in very slow running
// test.
// * Ensure that modifications to the returned value will not affect the
// internal state of your Shrink. If in doubt return by value not by reference
type Shrink func() (interface{}, bool)

// Filter creates a shrink filtered by a condition
Expand Down

0 comments on commit 715b638

Please sign in to comment.