summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
authorDaniel Schüssler <danlex@gmx.de>2009-01-19 10:41:49 +0000
committerDaniel Schüssler <danlex@gmx.de>2009-01-19 10:41:49 +0000
commit2b8aea01b22db9aedb5bd6bdc327a02bfa92e1c2 (patch)
tree2029e9cd03c6f4d0e27a4220f08c2f63f3ff59d5 /lib/Numeric/LinearAlgebra/Tests.hs
parentbde1d4bec13cfaa22fab938156c0860539637473 (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.hs8
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{- |
3Module : Numeric.LinearAlgebra.Tests 5Module : Numeric.LinearAlgebra.Tests
@@ -22,18 +24,16 @@ module Numeric.LinearAlgebra.Tests(
22import Numeric.LinearAlgebra 24import Numeric.LinearAlgebra
23import Numeric.LinearAlgebra.Tests.Instances 25import Numeric.LinearAlgebra.Tests.Instances
24import Numeric.LinearAlgebra.Tests.Properties 26import Numeric.LinearAlgebra.Tests.Properties
25import Test.QuickCheck hiding (test) 27import Test.HUnit hiding ((~:),test,Testable)
26import Test.HUnit hiding ((~:),test)
27import System.Info 28import System.Info
28import Data.List(foldl1') 29import Data.List(foldl1')
29import Numeric.GSL hiding (sin,cos,exp,choose) 30import Numeric.GSL hiding (sin,cos,exp,choose)
30import Prelude hiding ((^)) 31import Prelude hiding ((^))
31import qualified Prelude 32import qualified Prelude
33#include "Tests/quickCheckCompat.h"
32 34
33a ^ b = a Prelude.^ (b :: Int) 35a ^ b = a Prelude.^ (b :: Int)
34 36
35qCheck n = check defaultConfig {configSize = const n}
36
37utest str b = TestCase $ assertBool str b 37utest str b = TestCase $ assertBool str b
38 38
39feye n = flipud (ident n) :: Matrix Double 39feye n = flipud (ident n) :: Matrix Double