Making sure that it builds is annoying
This commit is contained in:
26
tests/Tests/Example/Project.hs
Normal file
26
tests/Tests/Example/Project.hs
Normal file
@ -0,0 +1,26 @@
|
||||
module Tests.Example.Project where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Test.Tasty
|
||||
import Test.Tasty.TH
|
||||
import Test.Tasty.Hedgehog
|
||||
|
||||
import Hedgehog ((===))
|
||||
import qualified Hedgehog as H
|
||||
import qualified Hedgehog.Gen as Gen
|
||||
import qualified Hedgehog.Range as Range
|
||||
|
||||
import Example.Project (plus)
|
||||
|
||||
prop_plusIsCommutative :: H.Property
|
||||
prop_plusIsCommutative = H.property $ do
|
||||
a <- H.forAll (Gen.integral (Range.linear minBound maxBound))
|
||||
b <- H.forAll (Gen.integral (Range.linear minBound maxBound))
|
||||
plus a b === plus b a
|
||||
|
||||
tests :: TestTree
|
||||
tests = $(testGroupGenerator)
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain tests
|
8
tests/doctests.hs
Normal file
8
tests/doctests.hs
Normal file
@ -0,0 +1,8 @@
|
||||
module Main where
|
||||
|
||||
import System.Environment (getArgs)
|
||||
import Test.DocTest (mainFromCabal)
|
||||
|
||||
main :: IO ()
|
||||
main = mainFromCabal "simple" =<< getArgs
|
||||
|
10
tests/unittests.hs
Normal file
10
tests/unittests.hs
Normal file
@ -0,0 +1,10 @@
|
||||
import Prelude
|
||||
|
||||
import Test.Tasty
|
||||
|
||||
import qualified Tests.Example.Project
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain $ testGroup "."
|
||||
[ Tests.Example.Project.tests
|
||||
]
|
Reference in New Issue
Block a user