summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-02-11 12:35:17 +1100
committerJed Barber <jjbarber@y7mail.com>2014-02-11 12:35:17 +1100
commit2c62573e6ec103a379649b8bfc066aec046eb04d (patch)
tree4d1d9d6ad9a5ac4e962d93ac868f0b6bfc8b4caf
parent8b2a36040a58f6dce12866537a3110d11ab4ba9b (diff)
More unit tests
-rw-r--r--test.hs21
1 files 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]