Skip to content

Commit

Permalink
Reduce test case size
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Apr 30, 2018
1 parent 29544f2 commit a7ef89c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/ChebyshevSpec.hs
Expand Up @@ -40,11 +40,19 @@ prop_Chebyshev_recurrence (NonNegative (Small n)) x =



prop_Chebyshev_approx :: [Double] -> Property
prop_Chebyshev_approx cs' =
newtype Small1 a = Small1 a
deriving (Eq, Ord, Read, Show, Prelude.Functor)
instance Arbitrary a => Arbitrary (Small1 a) where
arbitrary = Small1 Prelude.<$> scale (`div` 10) arbitrary
shrink (Small1 x) = Small1 Prelude.<$> shrink x



prop_Chebyshev_approx :: Small1 [Double] -> Property
prop_Chebyshev_approx (Small1 cs') =
conjoin (zipWith (approx (1.0e-13 * maxc)) cs fcs)
where cs = cs' ++ [1]
maxc = maximum (fmap abs cs)
n = length cs
f = chebyshev cs
fcs = chebyshevApprox (2 * n) f
fcs = chebyshevApprox n f

0 comments on commit a7ef89c

Please sign in to comment.