Skip to content

Commit

Permalink
Add test for and! in gen CE
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonMN committed Dec 30, 2021
1 parent 9a11e9f commit 454dbdd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/Hedgehog.Tests/GenTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,20 @@ let genTests = testList "Gen tests" [
}
|> Property.check

testCase "apply is applicative" <| fun () ->
testCase "apply is applicative via function" <| fun () ->
let gPair =
Gen.constant (fun a b -> a, b)
|> Gen.apply (Range.constant 0 2 |> Gen.int32)
|> Gen.apply (Range.constant 0 1 |> Gen.int32)
testGenPairViaApply gPair

testCase "apply is applicative via CE" <| fun () ->
let gPair =
gen {
let! a = Range.constant 0 2 |> Gen.int32
and! b = Range.constant 0 1 |> Gen.int32
return a, b
}
testGenPairViaApply gPair

]

0 comments on commit 454dbdd

Please sign in to comment.