mirror of
https://github.com/maciej-bendkowski/generic-boltzmann-brain.git
synced 2024-08-17 08:30:30 +03:00
Numeric underscores in tests
This commit is contained in:
parent
79216f69b5
commit
66feb60074
@ -176,7 +176,7 @@ test-suite generic-boltzmann-brain-test
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
LambdaCase BangPatterns DerivingVia FlexibleInstances UndecidableInstances TypeApplications ScopedTypeVariables Rank2Types
|
||||
NumericUnderscores LambdaCase BangPatterns DerivingVia FlexibleInstances UndecidableInstances TypeApplications ScopedTypeVariables Rank2Types
|
||||
ghc-options: -O2 -Wall -Wcompat -Wmissing-export-lists -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -Wno-name-shadowing -fwarn-missing-signatures
|
||||
build-depends:
|
||||
QuickCheck >=2.14.2
|
||||
|
@ -185,6 +185,7 @@ tests:
|
||||
- tasty-quickcheck >= 0.10.0
|
||||
- QuickCheck >= 2.14.2
|
||||
default-extensions:
|
||||
NumericUnderscores
|
||||
LambdaCase
|
||||
BangPatterns
|
||||
DerivingVia
|
||||
|
@ -26,21 +26,21 @@ choiceTests =
|
||||
testGroup
|
||||
"Choice unit tests"
|
||||
[ testCase "[1/2, 1/2] is correctly sampled from" $ do
|
||||
[(0, a), (1, b)] <- choiceTest distributionA 1000000
|
||||
[(0, a), (1, b)] <- choiceTest distributionA 1_000_000
|
||||
a `almostEqual` 0.5
|
||||
b `almostEqual` 0.5
|
||||
, testCase "[1/3, 1/3, 1/3] is correctly sampled from" $ do
|
||||
[(0, a), (1, b), (2, c)] <- choiceTest distributionB 1000000
|
||||
[(0, a), (1, b), (2, c)] <- choiceTest distributionB 1_000_000
|
||||
a `almostEqual` 0.33
|
||||
b `almostEqual` 0.33
|
||||
c `almostEqual` 0.33
|
||||
, testCase "[1/7, 4/7, 2/7] is correctly sampled from" $ do
|
||||
[(0, a), (1, b), (2, c)] <- choiceTest distributionC 1000000
|
||||
[(0, a), (1, b), (2, c)] <- choiceTest distributionC 1_000_000
|
||||
a `almostEqual` 0.14
|
||||
b `almostEqual` 0.57
|
||||
c `almostEqual` 0.28
|
||||
, testCase "[1/1] is correctly sampled from" $ do
|
||||
[(0, a)] <- choiceTest distributionD 1000000
|
||||
[(0, a)] <- choiceTest distributionD 1_000_000
|
||||
a `almostEqual` 1.0
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user