0 | module Evince.Hedgehog 1 | 2 | import Evince.Core 3 | import Evince.Spec 4 | import Hedgehog 5 | 6 | %default covering 7 | 8 | runProperty : Property -> IO (TestResult ()) 9 | runProperty p = do 10 | passed <- check p 11 | pure $ if passed 12 | then Pass () 13 | else Fail (Reason "property check failed") 14 | 15 | ||| Embed a hedgehog Property as an evince test case. 16 | export 17 | prop : String -> Property -> Spec a () 18 | prop label p = itIO label (runProperty p) 19 | 20 | ||| Embed a PropertyT action (wraps in `property`). 21 | export 22 | itProp : String -> PropertyT () -> Spec a () 23 | itProp label = prop label . property 24 | 25 | ||| Embed a single-run property (wraps in `property1`). 26 | export 27 | itProp1 : String -> PropertyT () -> Spec a () 28 | itProp1 label = prop label . property1 29 |