diff options
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 52 |
1 files changed, 43 insertions, 9 deletions
@@ -1,19 +1,53 @@ -module Main (main) where +module Main(main) where + +import Network.EBus.Layer2 as L2 + +-- main = do +-- -- * Select binary mode (True) or text mode (False) on a open handle. (See also openBinaryFile.) +-- hSetBinaryMode stdin True +-- -- * run +-- -- Run an iteratee until it finishes, and return either the final value (if it succeeded) or the error (if it failed). +-- -- * run_ +-- -- Like run, except errors are converted to exceptions and thrown. Primarily useful for small scripts or other simple cases. + +-- maybePacket <- run( enumSource $$ runParser ) +-- case maybePacket of +-- Right result -> print result +-- Left error -> print error + +-- maybePacket <- run( enumSource $$ runParser ) +-- case maybePacket of +-- Right result -> print result +-- Left error -> print error + + +-- enumSource :: Enumerator ByteString IO a +-- enumSource = enumHandle 1 stdin + +-- runParser :: Iteratee ByteString IO EbusPacket +-- runParser = do +-- p <- iterParser parser +-- return p import Test.Framework -import qualified Test.Framework as TF import Test.Framework.Providers.HUnit -import Test.HUnit -import Control.Concurrent (forkOS) -import Control.Concurrent.MVar (MVar, newEmptyMVar, readMVar, putMVar) -import Control.Exception (finally) -import Control.Monad.Trans (liftIO) +main = + defaultMain [ + testGroup "SomeModule" [ testCase "foo" foooo] + ] -import qualified Data.Binary as B +foooo :: IO() +foooo = do + print "OK" -import Network.EBus.Layer2 as L2 +-- import Control.Concurrent (forkOS) +-- import Control.Concurrent.MVar (MVar, newEmptyMVar, readMVar, putMVar) +-- import Control.Exception (finally) +-- import Control.Monad.Trans (liftIO) + +-- import qualified Data.Binary as B -- import qualified System.ZMQ as ZMQ |