summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs52
1 files changed, 43 insertions, 9 deletions
diff --git a/Test.hs b/Test.hs
index c658e08..c5393bc 100644
--- a/Test.hs
+++ b/Test.hs
@@ -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