[tests] introduce a new checker for hunit based on the property checker
This commit is contained in:
parent
6e5ad0c640
commit
58c6efe4c4
@ -14,6 +14,7 @@ import Crypto.Number.Serialize (os2ip)
|
|||||||
import Prelude
|
import Prelude
|
||||||
|
|
||||||
import Test.Tasty.QuickCheck
|
import Test.Tasty.QuickCheck
|
||||||
|
import Test.Tasty.HUnit ((@=?))
|
||||||
|
|
||||||
newtype TestDRG = TestDRG (Word64, Word64, Word64, Word64, Word64)
|
newtype TestDRG = TestDRG (Word64, Word64, Word64, Word64, Word64)
|
||||||
deriving (Show,Eq)
|
deriving (Show,Eq)
|
||||||
@ -142,3 +143,6 @@ propertyHold l =
|
|||||||
| a == b = acc
|
| a == b = acc
|
||||||
| otherwise =
|
| otherwise =
|
||||||
(name ++ ": expected " ++ show a ++ " but got: " ++ show b) : acc
|
(name ++ ": expected " ++ show a ++ " but got: " ++ show b) : acc
|
||||||
|
|
||||||
|
propertyHoldCase :: [PropertyTest] -> IO ()
|
||||||
|
propertyHoldCase l = True @=? propertyHold l
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user