diff options
author | Daniel Schüssler <danlex@gmx.de> | 2009-01-19 10:41:49 +0000 |
---|---|---|
committer | Daniel Schüssler <danlex@gmx.de> | 2009-01-19 10:41:49 +0000 |
commit | 2b8aea01b22db9aedb5bd6bdc327a02bfa92e1c2 (patch) | |
tree | 2029e9cd03c6f4d0e27a4220f08c2f63f3ff59d5 /lib/Numeric/LinearAlgebra/Tests.hs | |
parent | bde1d4bec13cfaa22fab938156c0860539637473 (diff) |
Compatibility with QuickCheck 2 as well as QuickCheck 1
Used the C preprocessor to make it compile against either QuickCheck version. Added some implementations for the new "shrink" method of class Arbitrary.
The tests (runTests 10) succeed when compiled with QC 1.
With QC 2 (runTests 10 too) the fourth "vector operations" test (complex trigonometry) now fails. I don't know whether this is a bug in my changes, or whether QC 2 just generates Doubles differently and thus uncovered a real bug.
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 9617a7a..8b92287 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -1,3 +1,5 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
2 | {-# OPTIONS_GHC -fno-warn-unused-imports #-} | ||
1 | ----------------------------------------------------------------------------- | 3 | ----------------------------------------------------------------------------- |
2 | {- | | 4 | {- | |
3 | Module : Numeric.LinearAlgebra.Tests | 5 | Module : Numeric.LinearAlgebra.Tests |
@@ -22,18 +24,16 @@ module Numeric.LinearAlgebra.Tests( | |||
22 | import Numeric.LinearAlgebra | 24 | import Numeric.LinearAlgebra |
23 | import Numeric.LinearAlgebra.Tests.Instances | 25 | import Numeric.LinearAlgebra.Tests.Instances |
24 | import Numeric.LinearAlgebra.Tests.Properties | 26 | import Numeric.LinearAlgebra.Tests.Properties |
25 | import Test.QuickCheck hiding (test) | 27 | import Test.HUnit hiding ((~:),test,Testable) |
26 | import Test.HUnit hiding ((~:),test) | ||
27 | import System.Info | 28 | import System.Info |
28 | import Data.List(foldl1') | 29 | import Data.List(foldl1') |
29 | import Numeric.GSL hiding (sin,cos,exp,choose) | 30 | import Numeric.GSL hiding (sin,cos,exp,choose) |
30 | import Prelude hiding ((^)) | 31 | import Prelude hiding ((^)) |
31 | import qualified Prelude | 32 | import qualified Prelude |
33 | #include "Tests/quickCheckCompat.h" | ||
32 | 34 | ||
33 | a ^ b = a Prelude.^ (b :: Int) | 35 | a ^ b = a Prelude.^ (b :: Int) |
34 | 36 | ||
35 | qCheck n = check defaultConfig {configSize = const n} | ||
36 | |||
37 | utest str b = TestCase $ assertBool str b | 37 | utest str b = TestCase $ assertBool str b |
38 | 38 | ||
39 | feye n = flipud (ident n) :: Matrix Double | 39 | feye n = flipud (ident n) :: Matrix Double |