diff options
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) |