Last active
February 10, 2017 14:56
-
-
Save deque-blog/26f7bf7b9322745acb08f6e8a204e289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shrinking :: (Show a) => Shrink a -> a -> (a -> Result) -> Result | |
shrinking shrink arg runSub = | |
let children = shrink arg -- Get the children of the current branch | |
result = findFailing children runSub -- Look for the first failure | |
in case result of | |
Nothing -> Success | |
Just (shrunk, failure) -> -- In case a failure is found | |
shrinking shrink shrunk runSub -- Try to shrink further the child | |
<> -- OR (in case it fails) | |
addToCounterExample shrunk failure -- Add child to the counter example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment