]> Git — Sourcephile - literate-phylomemy.git/blob - tests/Phylomemy/SimilaritySpec.hs
init
[literate-phylomemy.git] / tests / Phylomemy / SimilaritySpec.hs
1 {-# OPTIONS_GHC -Wno-orphans #-}
2
3 module Phylomemy.SimilaritySpec where
4
5 import Data.Function ((.))
6 import Data.Functor ((<$>))
7 import Data.GenValidity.Map ()
8 import Data.GenValidity.Set ()
9 import Data.GenValidity.Text ()
10 import Data.GenValidity.Time ()
11 import Data.Validity.Map ()
12 import Data.Validity.Set ()
13 import Data.Validity.Text ()
14 import Numeric.Decimal (Decimal (..), unwrapDecimal)
15 import Numeric.Probability (Probability, ProbabilityBounded (..))
16 import Test.Syd
17 import Test.Syd.Validity
18
19 import Phylomemy
20 import Phylomemy.IndexationSpec ()
21
22 instance GenValid ProbabilityBounded where
23 genValid = genWordX
24 shrinkValid = (ProbabilityBounded <$>) . shrinkValid . unProbabilityBounded
25 instance GenValid Probability where
26 genValid = Decimal <$> genValid
27 shrinkValid = (Decimal <$>) . shrinkValid . unwrapDecimal
28
29 -- instance GenValid (Similarities Probability) where
30 -- genValid = genValidStructurallyWithoutExtraChecking
31 -- shrinkValid = shrinkValidStructurallyWithoutExtraFiltering
32
33 spec :: Spec
34 spec = do
35 genValidSpec @Probability
36 genValidSpec @(Similarities Probability)