speculation/Test.hs

28 lines
827 B
Haskell
Raw Normal View History

{-# LANGUAGE BangPatterns #-}
2010-06-28 09:25:18 +04:00
module Main where
import Prelude hiding ((||),(&&))
import Test.Framework (Test)
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2 (testProperty)
2010-06-28 09:25:18 +04:00
import Test.QuickCheck hiding ((==>))
-- import Test.HUnit hiding (Test)
import Control.Concurrent.Speculation
2010-06-28 09:25:18 +04:00
main :: IO ()
main = defaultMain tests
ignore :: Functor f => f a -> f ()
ignore = fmap (const ())
tests :: [Test]
tests =
[ testGroup "cases" $ zipWith (testCase . show) [1 :: Int ..] $
[]
, testGroup "properties" $ zipWith (testProperty . show) [1 :: Int ..] $
[ property $ \ a -> spec a (*2) a == ((*2) a :: Int) -- unevaluated
, property $ \ !a -> spec a (*2) a == ((*2) $! a :: Int) -- evaluated
]
2010-06-28 09:25:18 +04:00
]