@@ -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
7+
8+import Test.Unit.Generic
9+
10+%access export
11+
12+assertTrue : Bool -> IO Bool
13+assertTrue b = genericTest (Just "Assert True") b True (==)
14+
15+assertFalse : Bool -> IO Bool
16+assertFalse b = genericTest (Just "Assert False") b False (==)
17+
18+assertEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
19+assertEquals g e = genericTest (Just "Assert Equals") g e (==)
20+
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))
23+
24+assertJust : Show a => Maybe a -> IO Bool
25+assertJust g = genericTest (Just "Assert Is Just") (isJust g) True (==)
26+
27+assertNothing : Show a => Maybe a -> IO Bool
28+assertNothing g = genericTest (Just "Assert Is Nothing") (isNothing g) True (==)
29+
30+assertLeft : (Show a, Show b) => Either a b -> IO Bool
31+assertLeft g = genericTest (Just "Assert is Left") (isLeft g) True (==)
32+
33+assertRight : (Show a, Show b) => Either a b -> IO Bool
34+assertRight g = genericTest (Just "Assert is Right") (isRight g) True (==)
35+
36+-- --------------------------------------------------------------------- [ EOF ]