@@ -0,0 +1,36 @@
1+-- ---------------------------------------------------------- [ Assertions.idr ]
2+-- Module : Assertions.idr
3+-- Copyright : (c) The Idris Community
4+-- License : see LICENSE
5+-- --------------------------------------------------------------------- [ EOH ]
6+module Test.Unit.Assertions
8+import Test.Unit.Generic
12+assertTrue : Bool -> IO Bool
13+assertTrue b = genericTest (Just "Assert True") b True (==)
15+assertFalse : Bool -> IO Bool
16+assertFalse b = genericTest (Just "Assert False") b False (==)
18+assertEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
19+assertEquals g e = genericTest (Just "Assert Equals") g e (==)
21+assertNotEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
22+assertNotEquals g e = genericTest (Just "Assert Not Equals") g e (\x,y => not (x == y))
24+assertJust : Show a => Maybe a -> IO Bool
25+assertJust g = genericTest (Just "Assert Is Just") (isJust g) True (==)
27+assertNothing : Show a => Maybe a -> IO Bool
28+assertNothing g = genericTest (Just "Assert Is Nothing") (isNothing g) True (==)
30+assertLeft : (Show a, Show b) => Either a b -> IO Bool
31+assertLeft g = genericTest (Just "Assert is Left") (isLeft g) True (==)
33+assertRight : (Show a, Show b) => Either a b -> IO Bool
34+assertRight g = genericTest (Just "Assert is Right") (isRight g) True (==)
36+-- --------------------------------------------------------------------- [ EOF ]