diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-02-11 12:35:17 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-02-11 12:35:17 +1100 |
commit | 2c62573e6ec103a379649b8bfc066aec046eb04d (patch) | |
tree | 4d1d9d6ad9a5ac4e962d93ac868f0b6bfc8b4caf | |
parent | 8b2a36040a58f6dce12866537a3110d11ab4ba9b (diff) |
More unit tests
-rw-r--r-- | test.hs | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -23,13 +23,26 @@ fractranParser2 = TestCase (assertEqual "" (Right (FractranProgram [] 2)) (parseFractran "\n2")) ---fractranParser3 = TestCase (assertEqual "" --- (Left _) --- (parseFractran "2/3")) +fractranParser3 = TestCase (assertEqual "" + (Right (FractranProgram [(1,2)] 2)) + (parseFractran "2 1/2")) + +fractranParser4 = TestCase (assertEqual "" + (Right (FractranProgram [(2,3)] 3)) + (parseFractran "3\n \n2/3\n")) + + + +thueParser0 = TestCase (assertEqual "" + (Right (ThueProgram [ThueRule "a" "b"] "a")) + (parseThue "a::=b\n::=\na")) main = do putStrLn "Fractran Parser" - runTestTT $ TestList [fractranParser0, fractranParser1, fractranParser2] + runTestTT $ TestList [fractranParser0, fractranParser1, fractranParser2, fractranParser3, fractranParser4] + + putStrLn "\nThue Parser" + runTestTT $ TestList [thueParser0] |