packages feed

antigen 0.1.2.0 → 0.2.0.0

raw patch · 3 files changed

+20/−14 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Test.AntiGen: antiBool :: Bool -> AntiGen Bool
- Test.AntiGen: antiNum :: (Eq a, Num a, Arbitrary a) => a -> AntiGen a
- Test.AntiGen: antiTry :: (Eq a, Arbitrary a) => a -> AntiGen a
+ Test.AntiGen: fickleBool :: Bool -> AntiGen Bool
+ Test.AntiGen: fickleNum :: (Eq a, Num a, Arbitrary a) => a -> AntiGen a
+ Test.AntiGen: fickleTry :: (Eq a, Arbitrary a) => a -> AntiGen a
+ Test.AntiGen: fickleTryGen :: Eq a => a -> Gen a -> AntiGen a

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for antigen +## 0.1.3.0++* Rename `antiNum` and `antiBool` to `fickleNum` and `fickleBool`+* Rename `antiTry` and `antiTryGen` to `fickleTry` and `fickleTryGen`+ ## 0.1.2.0  * Fixed `sized` and `resize` implementations for `AntiGen`
antigen.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               antigen-version:            0.1.2.0+version:            0.2.0.0 synopsis:           Negatable QuickCheck generators  description:   AntiGen is a library that helps with generating negative examples from a 
src/Test/AntiGen.hs view
@@ -17,11 +17,12 @@   zapAntiGen,    -- * AntiGen combinators-  antiNum,-  antiBool,+  fickleNum,+  fickleBool,+  fickleTry,+  fickleTryGen,   antiChoose,   antiChooseBounded,-  antiTry,   antiPositive,   antiNonPositive,   antiNegative,@@ -44,13 +45,13 @@  -- | Returns the provided number. If negated, returns a value that is not equal -- to the provided number.-antiNum :: (Eq a, Num a, Arbitrary a) => a -> AntiGen a-antiNum n = pure n |! ((n +) . getNonZero <$> arbitrary)+fickleNum :: (Eq a, Num a, Arbitrary a) => a -> AntiGen a+fickleNum n = pure n |! ((n +) . getNonZero <$> arbitrary)  -- | Returns the provided `Bool`. If negated, returns the negation of that -- `Bool`.-antiBool :: Bool -> AntiGen Bool-antiBool b = pure b |! pure (not b)+fickleBool :: Bool -> AntiGen Bool+fickleBool b = pure b |! pure (not b)  -- | In the positive case generates a value from the first range. In the -- negative case generates a value from the second range excluding the first@@ -71,8 +72,8 @@           ]       )   where-    rngLo = (boundLo, lo)-    rngHi = (hi, boundHi)+    rngLo = (boundLo, pred lo)+    rngHi = (succ hi, boundHi)  -- | Generates a value from the range. If negated, returns a random value -- outside the range between `minBound` and `maxBound`.@@ -82,15 +83,15 @@ -- | Returns the provided value unless negated, in which case it generates an -- arbitrary value that is different from the provided value. It uses `suchThat`, -- so using it on small types might end up discarding many values.-antiTry :: (Eq a, Arbitrary a) => a -> AntiGen a-antiTry a = antiTryGen a arbitrary+fickleTry :: (Eq a, Arbitrary a) => a -> AntiGen a+fickleTry a = fickleTryGen a arbitrary  -- | Returns the provided value unless negated, in which case it uses the -- generator to generate a random value that is different from the provided -- value. It uses `suchThat`, so using it on small types might end up  -- discarding many values.-antiTryGen :: Eq a => a -> Gen a -> AntiGen a-antiTryGen a gen = pure a |! (gen `suchThat` (/= a))+fickleTryGen :: Eq a => a -> Gen a -> AntiGen a+fickleTryGen a gen = pure a |! (gen `suchThat` (/= a))  -- | Negatable generator for positive numbers antiPositive :: (Num a, Ord a, Arbitrary a) => AntiGen a