summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryanOSullivan <>2014-05-08 17:58:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-05-08 17:58:00 (GMT)
commit4e6eec9c54a4d70738878a51eb814a00ae2575a1 (patch)
tree63c364a389db1ce34704c3647729a0b2ae5ee7f6
parentb9bd45fcc09fc34cf696aafaf2a92dc99c5901d1 (diff)
version 0.11.0.10.11.0.1
-rw-r--r--statistics.cabal6
-rw-r--r--tests/Tests/Transform.hs18
2 files changed, 13 insertions, 11 deletions
diff --git a/statistics.cabal b/statistics.cabal
index cf01773..3828575 100644
--- a/statistics.cabal
+++ b/statistics.cabal
@@ -1,5 +1,5 @@
name: statistics
-version: 0.11.0.0
+version: 0.11.0.1
synopsis: A library of statistical types, data, and functions
description:
This library provides a number of common functions and types useful
@@ -90,7 +90,7 @@ library
Statistics.Sample.Internal
Statistics.Test.Internal
build-depends:
- base < 5,
+ base >= 4.4 && < 5,
binary >= 0.5.1.0,
deepseq >= 1.1.0.2,
erf,
@@ -136,7 +136,7 @@ test-suite tests
binary,
ieee754 >= 0.7.3,
HUnit,
- QuickCheck >= 2,
+ QuickCheck >= 2.7,
test-framework,
test-framework-quickcheck2,
test-framework-hunit,
diff --git a/tests/Tests/Transform.hs b/tests/Tests/Transform.hs
index faefabc..70b598a 100644
--- a/tests/Tests/Transform.hs
+++ b/tests/Tests/Transform.hs
@@ -14,7 +14,8 @@ import Statistics.Function (within)
import Statistics.Transform (CD, dct, fft, idct, ifft)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.QuickCheck (Positive(..), Property, Arbitrary(..), Gen, choose, vectorOf, printTestCase)
+import Test.QuickCheck (Positive(..), Arbitrary(..), Gen, choose, vectorOf, counterexample)
+import Test.QuickCheck.Property (Property(..))
import Tests.Helpers (testAssertion)
import Text.Printf (printf)
import qualified Data.Vector.Generic as G
@@ -82,19 +83,20 @@ t_impulse_offset k (Positive x) (Positive m) = G.all ok (fft v)
-- whole are approximate equal.
t_fftInverse :: (HasNorm (U.Vector a), U.Unbox a, Num a, Show a, Arbitrary a)
=> (U.Vector a -> U.Vector a) -> Property
-t_fftInverse roundtrip = do
+t_fftInverse roundtrip = MkProperty $ do
x <- genFftVector
let n = G.length x
x' = roundtrip x
d = G.zipWith (-) x x'
nd = vectorNorm d
nx = vectorNorm x
- id $ printTestCase "Original vector"
- $ printTestCase (show x )
- $ printTestCase "Transformed one"
- $ printTestCase (show x')
- $ printTestCase (printf "Length = %i" n)
- $ printTestCase (printf "|x - x'| / |x| = %.6g" (nd / nx))
+ unProperty
+ $ counterexample "Original vector"
+ $ counterexample (show x )
+ $ counterexample "Transformed one"
+ $ counterexample (show x')
+ $ counterexample (printf "Length = %i" n)
+ $ counterexample (printf "|x - x'| / |x| = %.6g" (nd / nx))
$ nd <= 3e-14 * nx
-- Test discrete cosine transform