aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-12-29 02:31:33 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-12-29 02:31:33 +0100
commit96d9932a71facce2b31c78fa00fe1adc35169ecb (patch)
tree0c6e5aa7b3f96a919749dd11bd69cbfb60a219ef /src
parentf9b387e371df9c3f91de9da7dd6ac3c4efb58ea0 (diff)
downloadverismith-96d9932a71facce2b31c78fa00fe1adc35169ecb.tar.gz
verismith-96d9932a71facce2b31c78fa00fe1adc35169ecb.zip
Make generation more controlled
Diffstat (limited to 'src')
-rw-r--r--src/Test/VeriFuzz/Verilog/AST.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Test/VeriFuzz/Verilog/AST.hs b/src/Test/VeriFuzz/Verilog/AST.hs
index f0178cf..4c3649d 100644
--- a/src/Test/VeriFuzz/Verilog/AST.hs
+++ b/src/Test/VeriFuzz/Verilog/AST.hs
@@ -15,6 +15,7 @@ Defines the types to build a Verilog AST.
module Test.VeriFuzz.Verilog.AST where
import Control.Lens
+import Control.Monad (replicateM)
import qualified Data.Graph.Inductive as G
import Data.String
import Data.Text (Text)
@@ -257,8 +258,9 @@ instance QC.Arbitrary Text where
arbitrary = T.pack <$> QC.arbitrary
instance QC.Arbitrary Identifier where
- arbitrary = Identifier . T.pack <$>
- (QC.shuffle (['a'..'z'] <> ['A'..'Z']) >>= QC.sublistOf)
+ arbitrary = do
+ l <- QC.choose (2, 10)
+ Identifier . T.pack <$> replicateM l (QC.elements ['a'..'z'])
instance QC.Arbitrary Number where
arbitrary = Number <$> QC.suchThat QC.arbitrary (>0) <*> QC.arbitrary