Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 3379032

Browse files
Use frequency instead of random Boolean
1 parent 4c5c4a1 commit 3379032

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/Test/Data/StrMap.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Partial.Unsafe (unsafePartial)
1919

2020
import Test.QuickCheck ((<?>), quickCheck, quickCheck', (===))
2121
import Test.QuickCheck.Arbitrary (class Arbitrary, arbitrary)
22+
import Test.QuickCheck.Gen as Gen
2223

2324
newtype TestStrMap v = TestStrMap (M.StrMap v)
2425

@@ -34,8 +35,8 @@ instance showInstruction :: (Show k, Show v) => Show (Instruction k v) where
3435
instance arbInstruction :: (Arbitrary v) => Arbitrary (Instruction String v) where
3536
arbitrary = do
3637
b <- arbitrary
37-
kIshasOwnProperty <- (&&) <$> arbitrary <*> arbitrary
38-
k <- if kIshasOwnProperty then pure "hasOwnProperty" else arbitrary
38+
k <- Gen.frequency (Tuple 10.0 (pure "hasOwnProperty"))
39+
(Tuple 50.0 arbitrary `Cons` Nil)
3940
case b of
4041
true -> do
4142
v <- arbitrary

0 commit comments

Comments
 (0)