From 1ea9de8136a961012e950fbcd43f212f95a43b6c Mon Sep 17 00:00:00 2001 From: Maciej Bendkowski Date: Sun, 27 Mar 2022 21:18:04 +0200 Subject: [PATCH] Move tests outside of the unit test folder --- generic-boltzmann-brain.cabal | 4 ++-- test/Spec.hs | 8 ++++---- test/Test/{Unit => }/BuffonMachine.hs | 10 +++++----- test/Test/{Unit => }/Sampler.hs | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) rename test/Test/{Unit => }/BuffonMachine.hs (95%) rename test/Test/{Unit => }/Sampler.hs (92%) diff --git a/generic-boltzmann-brain.cabal b/generic-boltzmann-brain.cabal index 34f6b9c..f0cddca 100644 --- a/generic-boltzmann-brain.cabal +++ b/generic-boltzmann-brain.cabal @@ -87,11 +87,11 @@ test-suite generic-boltzmann-brain-test type: exitcode-stdio-1.0 main-is: Spec.hs other-modules: + Test.BuffonMachine + Test.Sampler Test.Samplers.BinTree Test.Samplers.Lambda Test.Samplers.Tree - Test.Unit.BuffonMachine - Test.Unit.Sampler Test.Utils Paths_generic_boltzmann_brain hs-source-dirs: diff --git a/test/Spec.hs b/test/Spec.hs index fb339d7..ae486e9 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1,6 +1,6 @@ +import qualified Test.BuffonMachine as BuffonMachine +import qualified Test.Sampler as Sampler import Test.Tasty (TestTree, defaultMain, testGroup) -import qualified Test.Unit.BuffonMachine as BuffonMachine -import qualified Test.Unit.Sampler as Sampler main :: IO () main = defaultMain tests @@ -10,6 +10,6 @@ tests = testGroup "Unit tests" unitTests unitTests :: [TestTree] unitTests = - [ BuffonMachine.unitTests - , Sampler.unitTests + [ BuffonMachine.tests + , Sampler.tests ] diff --git a/test/Test/Unit/BuffonMachine.hs b/test/Test/BuffonMachine.hs similarity index 95% rename from test/Test/Unit/BuffonMachine.hs rename to test/Test/BuffonMachine.hs index b9d37a6..952be7f 100644 --- a/test/Test/Unit/BuffonMachine.hs +++ b/test/Test/BuffonMachine.hs @@ -1,4 +1,4 @@ -module Test.Unit.BuffonMachine (unitTests) where +module Test.BuffonMachine (tests) where import Control.Monad (replicateM) import Data.Boltzmann.BuffonMachine (Distribution (..), choice, evalIO) @@ -15,16 +15,16 @@ import Test.Tasty.HUnit ( testCase, ) -unitTests :: TestTree -unitTests = +tests :: TestTree +tests = testGroup - "BuffonMachine unit tests" + "BuffonMachine tests" [choiceTests] choiceTests :: TestTree choiceTests = testGroup - "Choice unit tests" + "Choice tests" [ testCase "[1/2, 1/2] is correctly sampled from" $ do [(0, a), (1, b)] <- choiceTest distributionA 1_000_000 a `almostEqual` 0.5 diff --git a/test/Test/Unit/Sampler.hs b/test/Test/Sampler.hs similarity index 92% rename from test/Test/Unit/Sampler.hs rename to test/Test/Sampler.hs index c2ece80..ff7a885 100644 --- a/test/Test/Unit/Sampler.hs +++ b/test/Test/Sampler.hs @@ -1,4 +1,4 @@ -module Test.Unit.Sampler (unitTests) where +module Test.Sampler (tests) where import Test.Samplers.BinTree (BinTree) import Test.Samplers.Lambda (BinLambda, Lambda) @@ -8,8 +8,8 @@ import Test.Utils (Size (size)) import Test.Tasty (TestTree, testGroup) import Test.Tasty.QuickCheck as QC (testProperty) -unitTests :: TestTree -unitTests = +tests :: TestTree +tests = testGroup "Sampler tests" [ QC.testProperty "BinTree sampler respects size constraints" $