PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/Psp/StructuresTest.hs

http://hdbc.googlecode.com/
Haskell | 22 lines | 18 code | 4 blank | 0 comment | 0 complexity | 2fe33019f696e73c46110e2b79d29cad MD5 | raw file
 1
 2module StructuresTest where
 3
 4import Structures
 5import Test.HUnit
 6import Data.Array
 7
 8allTests :: Test
 9allTests = TestList [TestLabel "testStateOrdering" testStateOrdering,
10                     TestLabel "testRange" testRange]
11
12testStateOrdering :: Test
13testStateOrdering = TestCase (do
14     assertBool "ProjectInactive is greater than everyone" (ProjectInactive "" > ProjectActive "" Waiting)
15     assertEqual "should be false" False (ProjectActive "" Paused > ProjectActive "" Waiting)
16     assertBool "should be true" (ProjectActive "" (Recording "") <= ProjectActive "" (Recording ""))
17                             )
18testRange :: Test
19testRange = TestCase (do
20    assertEqual "expect no elements" 0 (length(range (ProjectActive "root" (Recording "t0"), ProjectInactive "")))
21    assertEqual "just two elements" 2 (length(range (ProjectActive "" Waiting, ProjectActive "" Paused)))
22                )