module Tests.ByteHelperTest
where

import MetaJuicer.ByteHelper
import Test.QuickCheck

newtype MyTestInt= MyTestInt Int deriving (Show) 
instance Arbitrary MyTestInt where 
        arbitrary = (return . MyTestInt) =<< choose(0,4294967295) 
         
prop_ident_IntToByte :: MyTestInt -> Bool 
prop_ident_IntToByte (MyTestInt i) = (byteToInt $ intToByte i) == i

byteHelperTests :: IO()
byteHelperTests = putStrLn "\n\n\n===============================\nStarting ByteHelper Tests"
                  >> pwl "Running intToByte tests"
                  >> myCheck prop_ident_IntToByte
        where pwl = putStrLn . (++) "-----------------\n"  -- print with line
              myCheck :: (Testable a) => a -> IO ()
              myCheck = quickCheckWith (stdArgs {  maxSuccess= 1000})
