summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2012-03-17 22:39:10 +0100
committerYves Fischer <yvesf-git@xapek.org>2012-03-17 22:39:10 +0100
commit61517df00b34bb1b985705092de5e81d13fb59c9 (patch)
treeddf25ab97efa40525746eed8639c6d03a57496f7 /Test.hs
parent63d34635cc895019a3c4e510e5d10a6a715e2e85 (diff)
downloadhaskell-ebus-61517df00b34bb1b985705092de5e81d13fb59c9.tar.gz
haskell-ebus-61517df00b34bb1b985705092de5e81d13fb59c9.zip
tests && executables
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