summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-02-09 15:29:37 +1100
committerJed Barber <jjbarber@y7mail.com>2014-02-09 15:29:37 +1100
commita1fa6dcb2b6f022ce90f40df9bea82974611d71e (patch)
tree39613f04fd97a95570b309fb2b17aa435783b0df
parent4dbc7bf30e68bfff3b8b778fb631f2707882c65d (diff)
Began adding unit tests
-rw-r--r--test.hs30
1 files changed, 30 insertions, 0 deletions
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]
+