packages feed

extrapolate 0.2.2 → 0.2.3

raw patch · 4 files changed

+9/−15 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Test.Extrapolate.Core: ($-|) :: Testable a => a -> [Expr] -> Bool
+ Test.Extrapolate.Core: resultiers :: Testable a => a -> [[([Expr], Bool)]]
+ Test.Extrapolate.Core: tinstances :: Testable a => a -> Instances

Files

README.md view
@@ -123,8 +123,9 @@ There are two other tools for [Haskell] capable of producing generalized counter-examples: [SmartCheck] and [Lazy SmallCheck 2012]. -Extrapolate was accepted for presentation at [IFL 2017], a link to a-pre-symposium proceedings draft paper will be listed here soon.+Extrapolate was accepted for presentation at [IFL 2017],+see the pre-symposium proceedings+[paper about Extrapolate](https://matela.com.br/paper/extrapolate.pdf).  [extrapolate-on-hackage]:          https://hackage.haskell.org/package/extrapolate [Extrapolate from Hackage]:        https://hackage.haskell.org/package/extrapolate
extrapolate.cabal view
@@ -1,5 +1,5 @@ name:                extrapolate-version:             0.2.2+version:             0.2.3 synopsis:            generalize counter-examples of test properties description:   Extrapolate is a tool able to provide generalized counter-examples of test@@ -31,7 +31,7 @@ source-repository this   type:            git   location:        https://github.com/rudymatela/speculate-  tag:             v0.2.2+  tag:             v0.2.3  library   exposed-modules: Test.Extrapolate
src/Test/Extrapolate/Core.hs view
@@ -23,7 +23,6 @@   , bgOrd    , Option (..)-  , options   , WithOption (..)   , maxTests   , extraInstances@@ -46,7 +45,7 @@   , matchList   , newMatches -  , Testable+  , Testable (..)   , results    , areInstancesOf@@ -197,10 +196,7 @@   name xs  =  name (head xs) ++ "s"   expr (xs@[])      =  showConstant  ([]    -: xs)   expr (xs@(y:ys))  =  constant ":"  ((:) ->>: xs) :$ expr y :$ expr ys-  background xs  =  [ constant "length" (length -:> xs)-                    , constant "any"    (any    ->:> xs)-                    , constant "all"    (all    ->:> xs)-                    , constant "filter" (filter ->:> xs) ]+  background xs  =  [ constant "length" (length -:> xs) ]                  ++ [ constant "elem" (elemBy (*==*) ->:> xs) | hasEq (head xs) ]   instances xs  =  this xs $ instances (head xs) -- TODO: add (==) and (/=) when list element type has (==) and (/=)@@ -351,6 +347,7 @@   is = tinstances p  generalizationsCEC :: Testable a => Int -> a -> [Expr] -> [(Expr,[Expr])]+generalizationsCEC n p es | maxConditionSize p <= 0 = [] generalizationsCEC n p es =   [ (wc'', gs'')   | gs <- generalizations is es
tests/test-extrapolate.hs view
@@ -162,11 +162,7 @@ listBackgroundOK :: Generalizable a => a -> Bool listBackgroundOK x = backgroundListOf x `subset` backgroundOf [x]   where-  backgroundListOf x = [ constant "length" $ length  -:> [x]-                       , constant "any"    $ any    ->:> [x]-                       , constant "all"    $ all    ->:> [x]-                       , constant "filter" $ filter ->:> [x]-                       ]+  backgroundListOf x = [ constant "length" $ length  -:> [x] ]                      +++ backgroundOf x  maybeBackgroundOK :: Generalizable a => a -> Bool