diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2012-09-28 23:50:52 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2012-09-28 23:50:52 +0200 |
commit | 52d0b5284170588b24573164e60f99a4001f9b9d (patch) | |
tree | 45685caa51c80da564035e65717a19b9ca5b5298 /Test.hs | |
parent | 1270abb4ce6842d3b66f792d23358b97a530c4d5 (diff) | |
download | haskell-ebus-52d0b5284170588b24573164e60f99a4001f9b9d.tar.gz haskell-ebus-52d0b5284170588b24573164e60f99a4001f9b9d.zip |
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 46 |
1 files changed, 37 insertions, 9 deletions
@@ -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) |