From 2c62573e6ec103a379649b8bfc066aec046eb04d Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 11 Feb 2014 12:35:17 +1100 Subject: More unit tests --- test.hs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test.hs b/test.hs index 63e10ec..7b81228 100644 --- a/test.hs +++ b/test.hs @@ -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] -- cgit