Move tests outside of the unit test folder

This commit is contained in:
Maciej Bendkowski 2022-03-27 21:18:04 +02:00
parent 3931b6cdcc
commit 1ea9de8136
4 changed files with 14 additions and 14 deletions

View File

@ -87,11 +87,11 @@ test-suite generic-boltzmann-brain-test
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: Spec.hs main-is: Spec.hs
other-modules: other-modules:
Test.BuffonMachine
Test.Sampler
Test.Samplers.BinTree Test.Samplers.BinTree
Test.Samplers.Lambda Test.Samplers.Lambda
Test.Samplers.Tree Test.Samplers.Tree
Test.Unit.BuffonMachine
Test.Unit.Sampler
Test.Utils Test.Utils
Paths_generic_boltzmann_brain Paths_generic_boltzmann_brain
hs-source-dirs: hs-source-dirs:

View File

@ -1,6 +1,6 @@
import qualified Test.BuffonMachine as BuffonMachine
import qualified Test.Sampler as Sampler
import Test.Tasty (TestTree, defaultMain, testGroup) import Test.Tasty (TestTree, defaultMain, testGroup)
import qualified Test.Unit.BuffonMachine as BuffonMachine
import qualified Test.Unit.Sampler as Sampler
main :: IO () main :: IO ()
main = defaultMain tests main = defaultMain tests
@ -10,6 +10,6 @@ tests = testGroup "Unit tests" unitTests
unitTests :: [TestTree] unitTests :: [TestTree]
unitTests = unitTests =
[ BuffonMachine.unitTests [ BuffonMachine.tests
, Sampler.unitTests , Sampler.tests
] ]

View File

@ -1,4 +1,4 @@
module Test.Unit.BuffonMachine (unitTests) where module Test.BuffonMachine (tests) where
import Control.Monad (replicateM) import Control.Monad (replicateM)
import Data.Boltzmann.BuffonMachine (Distribution (..), choice, evalIO) import Data.Boltzmann.BuffonMachine (Distribution (..), choice, evalIO)
@ -15,16 +15,16 @@ import Test.Tasty.HUnit (
testCase, testCase,
) )
unitTests :: TestTree tests :: TestTree
unitTests = tests =
testGroup testGroup
"BuffonMachine unit tests" "BuffonMachine tests"
[choiceTests] [choiceTests]
choiceTests :: TestTree choiceTests :: TestTree
choiceTests = choiceTests =
testGroup testGroup
"Choice unit tests" "Choice tests"
[ testCase "[1/2, 1/2] is correctly sampled from" $ do [ testCase "[1/2, 1/2] is correctly sampled from" $ do
[(0, a), (1, b)] <- choiceTest distributionA 1_000_000 [(0, a), (1, b)] <- choiceTest distributionA 1_000_000
a `almostEqual` 0.5 a `almostEqual` 0.5

View File

@ -1,4 +1,4 @@
module Test.Unit.Sampler (unitTests) where module Test.Sampler (tests) where
import Test.Samplers.BinTree (BinTree) import Test.Samplers.BinTree (BinTree)
import Test.Samplers.Lambda (BinLambda, Lambda) import Test.Samplers.Lambda (BinLambda, Lambda)
@ -8,8 +8,8 @@ import Test.Utils (Size (size))
import Test.Tasty (TestTree, testGroup) import Test.Tasty (TestTree, testGroup)
import Test.Tasty.QuickCheck as QC (testProperty) import Test.Tasty.QuickCheck as QC (testProperty)
unitTests :: TestTree tests :: TestTree
unitTests = tests =
testGroup testGroup
"Sampler tests" "Sampler tests"
[ QC.testProperty "BinTree sampler respects size constraints" $ [ QC.testProperty "BinTree sampler respects size constraints" $