@@ -3,16 +3,17 @@
3-- Copyright : (c) The Idris Community
3-- Copyright : (c) The Idris Community
4-- License : see LICENSE
4-- License : see LICENSE
5-- --------------------------------------------------------------------- [ EOH ]
5-- --------------------------------------------------------------------- [ EOH ]
6+||| Some simple assertions.
6module Test.Unit.Assertions
7module Test.Unit.Assertions
8import Test.Unit.Generic
9import Test.Unit.Generic
10%access export
11%access export
12−assertTrue : Bool -> IO Bool
13+assertTrue : (given : Bool) -> IO Bool
13assertTrue b = genericTest (Just "Assert True") b True (==)
14assertTrue b = genericTest (Just "Assert True") b True (==)
15−assertFalse : Bool -> IO Bool
16+assertFalse : (given : Bool) -> IO Bool
16assertFalse b = genericTest (Just "Assert False") b False (==)
17assertFalse b = genericTest (Just "Assert False") b False (==)
18assertEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
19assertEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
@@ -21,16 +22,16 @@ assertEquals g e = genericTest (Just "Assert Equals") g e (==)
21assertNotEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
22assertNotEquals : (Eq a, Show a) => (given : a) -> (expected : a) -> IO Bool
22assertNotEquals g e = genericTest (Just "Assert Not Equals") g e (\x,y => not (x == y))
23assertNotEquals g e = genericTest (Just "Assert Not Equals") g e (\x,y => not (x == y))
24−assertJust : Show a => Maybe a -> IO Bool
25+assertJust : Show a => (given : Maybe a) -> IO Bool
25assertJust g = genericTest (Just "Assert Is Just") (isJust g) True (==)
26assertJust g = genericTest (Just "Assert Is Just") (isJust g) True (==)
27−assertNothing : Show a => Maybe a -> IO Bool
28+assertNothing : Show a => (given : Maybe a) -> IO Bool
28assertNothing g = genericTest (Just "Assert Is Nothing") (isNothing g) True (==)
29assertNothing g = genericTest (Just "Assert Is Nothing") (isNothing g) True (==)
30−assertLeft : (Show a, Show b) => Either a b -> IO Bool
31+assertLeft : (Show a, Show b) => (given : Either a b) -> IO Bool
31assertLeft g = genericTest (Just "Assert is Left") (isLeft g) True (==)
32assertLeft g = genericTest (Just "Assert is Left") (isLeft g) True (==)
33−assertRight : (Show a, Show b) => Either a b -> IO Bool
34+assertRight : (Show a, Show b) => (given : Either a b) -> IO Bool
34assertRight g = genericTest (Just "Assert is Right") (isRight g) True (==)
35assertRight g = genericTest (Just "Assert is Right") (isRight g) True (==)
36-- --------------------------------------------------------------------- [ EOF ]
37-- --------------------------------------------------------------------- [ EOF ]