Commits

Anonymous committed e5baea8

Modernize the Haskell and modernize the test driver.

Comments (0)

Files changed (6)

 > module Main where
 
-> import System
+> import System.Environment
+> import System.Exit
 
 > import Robin.Parser (parseRobin)
 > import Robin.Module (evalRobin, mkModuleCache)

Robin/CrudeIO.lhs

 > module Robin.CrudeIO where
 
 > import Control.Concurrent (myThreadId)
+> import qualified Control.Exception as Exc
 
 > import Robin.Chan
 > import Robin.Expr
 >     inputHandler' chan subscribers
 
 > inputHandler' chan subscribers = do
->     line <- getLine `catch` (\e -> do return "eof")
+>     line <- getLine `Exc.catch` excHandler
 >     subscribers' <- getAnyNewSubscribers chan subscribers
 >     case parseRobin line of
 >         Right expr@(Symbol "eof") -> do
 >             inputHandler' chan subscribers'
 >         Left _ ->
 >             inputHandler' chan subscribers'
+>   where
+>      excHandler :: Exc.SomeException -> IO String
+>      excHandler _ = do return "eof"
 
 > getAnyNewSubscribers :: Chan Expr -> [Expr] -> IO [Expr]
 

doc/module/CrudeIO.markdown

     = hello-world
     = ok
 
-    -> Functionality "Interpret Robin Program without output" is implemented by
-    -> shell command "bin/robin -n %(test-file)"
-
     -> Tests for functionality "Interpret Robin Program without output"
 
 The sending process need not do anything with the response.  The

fixture/config/BuiltInSmall.markdown

+    -> Functionality "Interpret Robin Program" is implemented by shell command
+    -> "bin/robin -m module -m fixture/module %(test-file)"
+
+    -> Functionality "Interpret Robin Program without output" is implemented by shell command
+    -> "bin/robin -m module -n %(test-file)"

fixture/config/SmallInRobin.markdown

+    -> Functionality "Interpret Robin Program" is implemented by shell command
+    -> "bin/robin -m module -B small -m fixture/module %(test-file)"
+
+    -> Functionality "Interpret Robin Program without output" is implemented by shell command
+    -> "bin/robin -m module -B small -n %(test-file)"
 
 FILES_NO_BUILTIN_SMALL="doc/module/Small.markdown"
 
-# Hack for Robin & Falderal built with the ghc from Haskell Platform on Windows
-if [ -e bin/robin.exe ]; then
-    falderal test -b \
-                  -c "Interpret Robin Program" \
-                  -c "Interpret Robin Program without output" \
-                  -f 'Interpret Robin Program:shell command "bin\\robin.exe -m module -m fixture\\module %(test-file)"' \
-                  -f 'Interpret Robin Program without output:shell command "bin\\robin.exe -m module -n %(test-file)"' \
-                  ${FILES}
-    falderal test -b \
-                  -c "Interpret Robin Program" \
-                  -f 'Interpret Robin Program:shell command "bin\\robin.exe -B small -m module -m fixture\\module %(test-file)"' \
-                  ${FILES_NO_BUILTIN_SMALL}
-    rm -f results*
-else
-    falderal test -b \
-                  -c "Interpret Robin Program" \
-                  -f 'Interpret Robin Program:shell command "bin/robin -m module -m fixture/module %(test-file)"' \
-                  ${FILES}
-    falderal test -b \
-                  -c "Interpret Robin Program" \
-                  -f 'Interpret Robin Program:shell command "bin/robin -B small -m module -m fixture/module %(test-file)"' \
-                  ${FILES_NO_BUILTIN_SMALL}
-fi
+falderal test -b fixture/config/BuiltInSmall.markdown ${FILES}
+falderal test -b fixture/config/SmallInRobin.markdown ${FILES_NO_BUILTIN_SMALL}