Skip to content

Commit

Permalink
make test pass by catching exception and returning failure
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonMN authored and adam-becker committed Sep 11, 2021
1 parent 65bee19 commit 4cf4637
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Hedgehog/Property.fs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ module Property =
p |> toGen |> f |> ofGen

let map (f : 'a -> 'b) (x : Property<'a>) : Property<'b> =
let g = f |> Outcome.map |> GenTuple.mapSnd |> mapGen
g x
let g (j, outcome) =
try
(j, outcome |> Outcome.map f)
with e ->
(Journal.append j (Journal.singletonMessage (string e)), Failure)
let h = g |> Gen.map |> mapGen
h x

let private set (a: 'a) (property : Property<'b>) : Property<'a> =
property |> map (fun _ -> a)
Expand Down

0 comments on commit 4cf4637

Please sign in to comment.