summaryrefslogtreecommitdiff
path: root/Thue/Test.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-04-10 05:25:03 +1000
committerJed Barber <jjbarber@y7mail.com>2014-04-10 05:25:03 +1000
commit281425310c5db21f87981eeb9601a71d1974d98d (patch)
treebef4643d906c93622c311fef2cf758fe94f1f651 /Thue/Test.hs
parente8695600977769008f285f9958eb043cca1b9b29 (diff)
Rearranging files
Diffstat (limited to 'Thue/Test.hs')
-rw-r--r--Thue/Test.hs52
1 files changed, 0 insertions, 52 deletions
diff --git a/Thue/Test.hs b/Thue/Test.hs
deleted file mode 100644
index 0273c48..0000000
--- a/Thue/Test.hs
+++ /dev/null
@@ -1,52 +0,0 @@
-module Thue.Test (
- parserTests,
- extractInfixTests,
- tests
- ) where
-
-
-import Test.HUnit
-import Text.Parsec.Error
-import Thue.Parser
-import Thue.Interpreter
-
-
-instance Eq Text.Parsec.Error.ParseError
-
-
-
-
-parser0 = (Right (ThueProgram [ThueRule "a" "b"] "a")) ~=? (parseThue "a::=b\n::=\na")
-
-parser1 = (Right (ThueProgram [] "b")) ~=? (parseThue "::=\nb")
-
-
-
-extractInfix0 = Nothing ~=? (extractInfix [1,2] [3,4,5])
-
-extractInfix1 = (Just ([1,2],[5,6])) ~=? (extractInfix [3,4] [1,2,3,4,5,6])
-
-extractInfix2 = (Just ([],[3,4])) ~=? (extractInfix [0,1,2] [0,1,2,3,4])
-
-extractInfix3 = (Just ([1],[])) ~=? (extractInfix [2,3] [1,2,3])
-
-extractInfix4 = (Just ([],[1])) ~=? (extractInfix [] [1])
-
-extractInfix5 = (Just ("before","after")) ~=? (extractInfix "middle" "beforemiddleafter")
-
-
-
-parserTests :: Test
-parserTests = TestList [parser0, parser1]
-
-
-
-extractInfixTests :: Test
-extractInfixTests = TestList [extractInfix0, extractInfix1, extractInfix2, extractInfix3, extractInfix4, extractInfix5]
-
-
-
-tests :: Test
-tests = case (parserTests, extractInfixTests) of
- (TestList a, TestList b) -> TestList (a ++ b)
-