summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2012-09-28 23:50:52 +0200
committerYves Fischer <yvesf-git@xapek.org>2012-09-28 23:50:52 +0200
commit52d0b5284170588b24573164e60f99a4001f9b9d (patch)
tree45685caa51c80da564035e65717a19b9ca5b5298 /Test.hs
parent1270abb4ce6842d3b66f792d23358b97a530c4d5 (diff)
downloadhaskell-ebus-master.tar.gz
haskell-ebus-master.zip
save modification - no ideaHEADmaster
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs46
1 files changed, 37 insertions, 9 deletions
diff --git a/Test.hs b/Test.hs
index c5393bc..ba2c4d6 100644
--- a/Test.hs
+++ b/Test.hs
@@ -1,6 +1,13 @@
module Main(main) where
+import Test.HUnit
+import Test.HUnit.Base
+
+import Data.Word (Word8)
+import Data.Bits (xor)
+
import Network.EBus.Layer2 as L2
+import Test.Layer2 as Test.Layer2
-- main = do
-- -- * Select binary mode (True) or text mode (False) on a open handle. (See also openBinaryFile.)
@@ -29,19 +36,40 @@ import Network.EBus.Layer2 as L2
-- p <- iterParser parser
-- return p
-import Test.Framework
-import Test.Framework.Providers.HUnit
+main = runTestTT $ TestList Test.Layer2.tests
+-- defaultMain [
+-- testGroup "SomeModule" [ testCase "foo" foooo]
+-- ]
+
+--tests = TestList [TestLabel "bla" foooo]
-main =
- defaultMain [
- testGroup "SomeModule" [ testCase "foo" foooo]
- ]
+tests = TestList [ ]
+
+
+--"Test:" ~: L2.ebusCrc [1 .. 7] ~=? 96
+-- , "Test:" ~: L2.ebusCrc [8,1,1,16,255,88,255,60,9] ~=? 247]
-foooo :: IO()
-foooo = do
- print "OK"
+-- listEnumerator :: Enumerator ByteString IO a
+-- listEnumerator = enumLists l
+-- where l::[[ByteString]]
+-- l = [[pack [1,2,3]]]
+
+
+--foooo = -- TestList(
+-- ~: ~=? "asd" 2 2
+-- assertBool "foo" True
+
+
+ -- print $ ebusCrc [1,2,3]
+ -- quickCheck (\s(\s -> length (take5 s) == 5)
+ -- if ebusCrc [1,2,3,4,5,6,7] == 96
+ -- then IO ()
+ -- else assertFailure "Failed"
+ -- print "\nOK"
+ -- )
+
-- import Control.Concurrent (forkOS)
-- import Control.Concurrent.MVar (MVar, newEmptyMVar, readMVar, putMVar)
-- import Control.Exception (finally)