aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Config.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-05-05 16:54:27 +0100
committerYann Herklotz <git@ymhg.org>2019-05-05 16:54:27 +0100
commitc31961da322d9700fd6604541cbce5a4042f9b24 (patch)
tree0825f105d6b52354eda203a9780e27a3989addcf /src/VeriFuzz/Config.hs
parent5c4bf34321e9ba334bcb4629f8cdf75b5e4912f0 (diff)
downloadverismith-c31961da322d9700fd6604541cbce5a4042f9b24.tar.gz
verismith-c31961da322d9700fd6604541cbce5a4042f9b24.zip
Add seeds for reproducible runs
Diffstat (limited to 'src/VeriFuzz/Config.hs')
-rw-r--r--src/VeriFuzz/Config.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs
index 8a3d422..9961667 100644
--- a/src/VeriFuzz/Config.hs
+++ b/src/VeriFuzz/Config.hs
@@ -74,13 +74,15 @@ module VeriFuzz.Config
)
where
-import Control.Applicative (Alternative, (<|>))
-import Control.Lens hiding ((.=))
-import Data.List.NonEmpty (NonEmpty (..))
-import Data.Maybe (fromMaybe)
-import Data.Text (Text)
-import qualified Data.Text.IO as T
-import Toml (TomlCodec, (.=))
+import Control.Applicative (Alternative, (<|>))
+import Control.Lens hiding ((.=))
+import Data.List.NonEmpty (NonEmpty (..))
+import Data.Maybe (fromMaybe)
+import Data.Text (Text)
+import qualified Data.Text.IO as T
+import Hedgehog.Internal.Seed (Seed)
+import qualified Hedgehog.Internal.Seed as Seed
+import Toml (TomlCodec, (.=))
import qualified Toml
-- $conf
@@ -224,7 +226,7 @@ data Probability = Probability { _probModItem :: {-# UNPACK #-} !ProbModItem
deriving (Eq, Show)
data Property = Property { _propSize :: {-# UNPACK #-} !Int
- , _propSeed :: !(Maybe Int)
+ , _propSeed :: !(Maybe Seed)
, _propStmntDepth :: {-# UNPACK #-} !Int
, _propModDepth :: {-# UNPACK #-} !Int
, _propMaxModules :: {-# UNPACK #-} !Int
@@ -363,7 +365,7 @@ propCodec =
Property
<$> defaultValue (defProp propSize) (Toml.int "size")
.= _propSize
- <*> Toml.dioptional (Toml.int "seed")
+ <*> Toml.dioptional (Toml.read "seed")
.= _propSeed
<*> defaultValue (defProp propStmntDepth) (int "statement" "depth")
.= _propStmntDepth