From 454dbdd62237a539175d9a81741f1406af213c05 Mon Sep 17 00:00:00 2001 From: Tyson Williams Date: Tue, 28 Dec 2021 20:58:58 -0600 Subject: [PATCH] Add test for and! in gen CE --- tests/Hedgehog.Tests/GenTests.fs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Hedgehog.Tests/GenTests.fs b/tests/Hedgehog.Tests/GenTests.fs index 2062f501..a54c67ac 100644 --- a/tests/Hedgehog.Tests/GenTests.fs +++ b/tests/Hedgehog.Tests/GenTests.fs @@ -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 + ]