From a1fa6dcb2b6f022ce90f40df9bea82974611d71e Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 9 Feb 2014 15:29:37 +1100 Subject: Began adding unit tests --- test.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test.hs diff --git a/test.hs b/test.hs new file mode 100644 index 0000000..a484e62 --- /dev/null +++ b/test.hs @@ -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] + -- cgit