Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

renaming of arguments.

  • Loading branch information...
commit d0f1549445544c4788d924981b69dcbb4108d84b 1 parent c6516f6
@leepike authored
View
2  examples/Div0.hs
@@ -73,7 +73,7 @@ divTest = smartCheck args prop_div
-- { maxSuccess = 1000
-- , maxSize = 20 }
, format = PrintString
- , extrap = True
+ , runForall = True
}
-- Get the minimal offending sub-value.
View
2  examples/Large.hs
@@ -65,7 +65,7 @@ prop_p :: B -> Property
prop_p p = pre p ==> test p
main :: IO ()
-main = smartCheck scStdArgs { extrap = False, constrGen = False } prop_p
+main = smartCheck scStdArgs { runForall = False, constrGen = False } prop_p
-- smartCheck scStdArgs { format = PrintString
-- , scMaxDepth = Just 20
-- }
View
4 src/Test/SmartCheck.hs
@@ -50,7 +50,7 @@ smartCheck args propT = do
-- Run the smart reduction algorithm.
d <- smartRun args r prop'
-- If we asked to extrapolate values, do so.
- valIdxs <- if extrap args
+ valIdxs <- if runForall args
then -- Extrapolate with the original property to see if we
-- get a previously-visited value back.
extrapolate args d prop
@@ -58,7 +58,7 @@ smartCheck args propT = do
-- If we asked to extrapolate constructors, do so, again with the original
-- property.
- csIdxs <- if constrGen args
+ csIdxs <- if runExists args
then constrsGen args d prop valIdxs
else return []
View
20 src/Test/SmartCheck/Args.hs
@@ -38,21 +38,21 @@ data ScArgs =
-- for failure in the reduction stage.
--------------
-- Extrapolation
- , extrap :: Bool -- ^ Should we extrapolate?
+ , runForall :: Bool -- ^ Should we extrapolate?
--------------
- , scMaxExtrap :: Int -- ^ How hard (number of rounds) to look
+ , scMaxForall :: Int -- ^ How hard (number of rounds) to look
-- for failures during the extrapolation
-- and constructor generalization stages.
--------------
- , scMinExtrap :: Int -- ^ Minimum number of times a property's
+ , scMinForall :: Int -- ^ Minimum number of times a property's
-- precondition must be passed to
-- generalize it.
--------------
-- Constructor generalization
- , constrGen :: Bool -- ^ Should we try to generalize
+ , runExists :: Bool -- ^ Should we try to generalize
-- constructors?
--------------
- , scConstrMax :: Int -- ^ How hard (number of rounds) to look
+ , scMaxExists :: Int -- ^ How hard (number of rounds) to look
-- for failing values with each
-- constructor. For "wide" sum types, this
-- value should be increased.
@@ -70,12 +70,12 @@ scStdArgs = ScArgs { format = PrintTree
---------------------
, scMaxReduce = 100
---------------------
- , extrap = True
- , scMaxExtrap = 20
- , scMinExtrap = 10
+ , runForall = True
+ , scMaxForall = 20
+ , scMinForall = 10
---------------------
- , constrGen = True
- , scConstrMax = 20
+ , runExists = True
+ , scMaxExists = 20
}
--------------------------------------------------------------------------------
View
2  src/Test/SmartCheck/ConstructorGen.hs
@@ -86,7 +86,7 @@ arbSubset :: (SubTypes a, Generic a, ConNames (Rep a))
-> S.Set String -> IO (Result a)
arbSubset args a idx prop constrs =
liftM snd $ iterateArbIdx a (idx, scMaxDepth args)
- (scConstrMax args) (scMaxSize args) prop'
+ (scMaxExists args) (scMaxSize args) prop'
where
prop' b = newConstr b Q.==> prop b
-- Make sure b's constructor is a new one.
View
4 src/Test/SmartCheck/Extrapolate.hs
@@ -43,7 +43,7 @@ extrapolate args d origProp = do
-- least one test passes a precondition, and for every test in which the
-- precondition is passed, it fails. We test values of all possible sizes, up
-- to Q.maxSize.
- test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxExtrap args)
+ test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxForall args)
(scMaxSize args) origProp
-- Control-flow.
@@ -51,7 +51,7 @@ extrapolate args d origProp = do
-- None of the tries satisfy prop (but something passed the precondition).
-- Prevent recurring down this tree, since we can generalize.
next _ (i, FailedProp) forest' idx idxs
- | scMinExtrap args < i =
+ | scMinForall args < i =
nextIter (forestReplaceChildren forest' idx False) idx (idx : idxs)
next _ _ forest' idx idxs = nextIter forest' idx idxs
Please sign in to comment.
Something went wrong with that request. Please try again.