Added first test suite with first test (questionable .cabal though)

This commit is contained in:
Jonas Betzendahl 2014-04-27 23:49:15 +02:00
parent b3c25a1326
commit f5f1f760cd
3 changed files with 52 additions and 1 deletions

View File

@ -12,6 +12,8 @@ executable Pioneers
ghc-options: -Wall -Odph -rtsopts -threaded -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -optlo-O3 -fllvm ghc-options: -Wall -Odph -rtsopts -threaded -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -optlo-O3 -fllvm
} }
other-modules: other-modules:
Map.Map,
Map.Combinators,
Map.Types, Map.Types,
Map.Graphics, Map.Graphics,
Map.Creation, Map.Creation,
@ -49,3 +51,32 @@ executable Pioneers
attoparsec-binary >= 0.1 attoparsec-binary >= 0.1
Default-Language: Haskell2010 Default-Language: Haskell2010
test-suite QuickCheckTests
type: exitcode-stdio-1.0
hs-source-dirs: tests, src
main-is: MainTestSuite.hs
build-depends: base,
OpenGL >=2.9,
bytestring >=0.10,
OpenGLRaw >=1.4,
text >=0.11,
array >=0.4,
random >=1.0.1,
transformers >=0.3.0,
unordered-containers >= 0.2.1,
hashable >= 1.0.1.1,
mtl >=2.1.2,
stm >=2.4.2,
vector >=0.10.9 && <0.11,
distributive >=0.3.2,
linear >=1.3.1,
lens >=4.0,
SDL2 >= 0.1.0,
time >=1.4.0,
GLUtil >= 0.7,
attoparsec >= 0.11.2,
attoparsec-binary >= 0.1,
QuickCheck,
test-framework,
test-framework-quickcheck2
Default-Language: Haskell2010

View File

@ -40,5 +40,5 @@ giveNeighbourhood mp n (a,b) = let ns = giveNeighbours mp (a,b) in
remdups :: Ord a => [a] -> [a] remdups :: Ord a => [a] -> [a]
remdups = map head . group . sort remdups = map head . group . sort
prop_rd_idempot :: Ord a => [a] -> Bool prop_rd_idempot :: [Int] -> Bool
prop_rd_idempot xs = remdups xs == (remdups . remdups) xs prop_rd_idempot xs = remdups xs == (remdups . remdups) xs

20
tests/MainTestSuite.hs Normal file
View File

@ -0,0 +1,20 @@
module Main where
import Test.Framework
import Test.Framework.Providers.QuickCheck2
import Map.Map
main :: IO ()
main = defaultMain tests
tests :: [Test]
tests =
[
testGroup "Map.Map"
[
testProperty "remdups idempotency" prop_rd_idempot
]
]