diff --git a/default.nix b/default.nix index a0883a3..b02396b 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,6 @@ -{ mkDerivation, base, Cabal, cabal-test-quickcheck, extra -, monad-loops, MonadRandom, pipes, protolude, QuickCheck -, quickcheck-instances, random, random-fu, random-shuffle, stdenv -, text +{ mkDerivation, base, Cabal, extra, monad-loops, MonadRandom, pipes +, protolude, QuickCheck, quickcheck-instances, random, random-fu +, random-shuffle, stdenv, text }: mkDerivation { pname = "ga"; @@ -14,13 +13,8 @@ mkDerivation { quickcheck-instances random random-fu random-shuffle text ]; executableHaskellDepends = [ - base extra monad-loops MonadRandom pipes protolude QuickCheck + base Cabal extra monad-loops MonadRandom pipes protolude QuickCheck quickcheck-instances random random-fu random-shuffle text ]; - testHaskellDepends = [ - base Cabal cabal-test-quickcheck extra monad-loops MonadRandom - pipes protolude QuickCheck quickcheck-instances random random-fu - random-shuffle text - ]; license = stdenv.lib.licenses.gpl3; } diff --git a/ga.cabal b/ga.cabal index c8f4452..9151bc2 100644 --- a/ga.cabal +++ b/ga.cabal @@ -56,16 +56,25 @@ executable ga , SS19 , WS19 +executable ga-tests + build-depends: base ^>=4.12.0.0 + , Cabal + , extra + , MonadRandom + , monad-loops , pipes , protolude , QuickCheck , quickcheck-instances + , random + , random-fu + , random-shuffle , text default-language: Haskell2010 hs-source-dirs: src - main-is: Main.hs + main-is: Test.hs other-modules: GA , Seminar , Pretty , SS19 - , WS19 + , WS19 \ No newline at end of file diff --git a/src/Seminar.hs b/src/Seminar.hs index aab70d6..c839fa1 100644 --- a/src/Seminar.hs +++ b/src/Seminar.hs @@ -1,5 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} module Seminar where @@ -161,3 +162,6 @@ valid :: Assignment -> Bool valid a = length a == length (nub $ fst <$> a) && length a == length (nub $ snd <$> a) +return [] + +runTests = $quickCheckAll diff --git a/src/Test.hs b/src/Test.hs new file mode 100644 index 0000000..ac1361e --- /dev/null +++ b/src/Test.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE NoImplicitPrelude #-} + +module Main where + +import Protolude +import qualified Seminar + +main :: IO () +main = do + _ <- Seminar.runTests + return ()