diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-02-09 15:29:37 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-02-09 15:29:37 +1100 |
commit | a1fa6dcb2b6f022ce90f40df9bea82974611d71e (patch) | |
tree | 39613f04fd97a95570b309fb2b17aa435783b0df | |
parent | 4dbc7bf30e68bfff3b8b778fb631f2707882c65d (diff) |
Began adding unit tests
-rw-r--r-- | test.hs | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ + +import Test.HUnit +import Thue.Parser +import Fractran.Parser + + + + +fractranParser1 = TestCase (assertEqual "" + (Right (FractranProgram [] 2)) + (parseFractran "2")) + +fractranParser2 = TestCase (assertEqual "" + (Right (FractranProgram [] 2)) + (parseFractran "2\n")) + +fractranParser3 = TestCase (assertEqual "" + (Right (FractranProgram [] 2)) + (parseFractran "\n2")) + +fractranParser4 = TestCase (assertEqual "" + (Left x) + (parseFractran "2/3")) + + + +main = do + putStrLn "Fractran Parser" + runTestTT $ TestList [fractranParser1, fractranParser2, fractranParser3, fractranParser4] + |