Initial Import
[glAntsMech.git] / octanemech / src / Tests / GLTestsExample.hs
blob0f42c02161f3c0677e9cda7c115c212d79cfc59f
1 --
2 --
3 module Tests.GLTests where
5 import HUnit
7 foo :: Int -> (Int, Int)
8 foo x = (1, x)
10 exampleTestUtilOne :: Int -> IO (Int, Int)
11 exampleTestUtilOne v = return (v+2, v+3)
13 exampleTestUtilTwo :: Int -> IO Bool
14 exampleTestUtilTwo v = return (v > 5)
16 -----------------------------
17 -- Test Cases
18 -----------------------------
20 -- Will Give an Error
21 test1 = TestCase (assertEqual "Test Case - call foo 3):"
22 (1,2) (foo 3))
24 test2 = TestCase (do (x,y) <- exampleTestUtilOne 3
25 assertEqual "Test Case - for the first result of [TestOne]: " 5 x
26 b <- exampleTestUtilTwo y
27 assertBool ("Test Case - [TestTwo]: " ++ show y ++ " failed") b)
29 tests = TestList [ TestLabel "Test 1" test1,
30 TestLabel "Test 2" test2 ]