From 52d0b5284170588b24573164e60f99a4001f9b9d Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Fri, 28 Sep 2012 23:50:52 +0200 Subject: save modification - no idea --- Test.hs | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) (limited to 'Test.hs') 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) -- cgit v1.2.1