summaryrefslogtreecommitdiff
path: root/src/Grasp/Test.hs
blob: ec45fb3738a6750ad759bd29c9c9800bc15de4a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module Grasp.Test (
	parserTests,
	tests
    ) where


import Test.HUnit
import Text.Parsec.Error
import Grasp.Parser


instance Eq Text.Parsec.Error.ParseError




isParseError :: Either a b -> Bool
isParseError (Left _) = True
isParseError (Right _) = False



parser0 = TestCase (assertBool "" (isParseError (parseGrasp "")) )

parser1 = TestCase (assertBool "" (isParseError (parseGrasp "digraph {")) )

parser2 = TestCase (assertBool "" (isParseError (parseGrasp "digraph { }")) )



parserTests :: Test
parserTests = TestList [parser0, parser1, parser2]



tests :: Test
tests = parserTests