-- Additional test dependencies.
HUnit == 1.2.*,
QuickCheck == 2.*,
- test-framework == 0.6.*,
- test-framework-hunit == 0.2.*,
- test-framework-quickcheck2 == 0.2.*
+ test-framework == 0.8.*,
+ test-framework-hunit == 0.3.*,
+ test-framework-quickcheck2 == 0.3.*
main-is:
Main.hs
hs-source-dirs: test
main-is: Doctests.hs
build-depends:
- base == 4.5.*,
+ base == 4.6.*,
-- Additional test dependencies.
- doctest == 0.7.*
+ doctest == 0.9.*
-- It's not entirely clear to me why I have to reproduce all of this.
ghc-options:
hs-source-dirs: src test
main-is: TestSuite.hs
build-depends:
- base == 4.5.*,
+ base == 4.6.*,
cmdargs == 0.10.*,
filepath == 1.*,
- MissingH == 1.1.*,
+ MissingH == 1.2.*,
repa == 3.2.*,
repa-algorithms == 3.2.*,
repa-io == 3.2.*,
- vector == 0.9.*,
+ vector == 0.10.*,
-- Additional test dependencies.
HUnit == 1.2.*,
QuickCheck == 2.*,
- test-framework == 0.6.*,
- test-framework-hunit == 0.2.*,
- test-framework-quickcheck2 == 0.2.*
+ test-framework == 0.8.*,
+ test-framework-hunit == 0.3.*,
+ test-framework-quickcheck2 == 0.3.*
-- It's not entirely clear to me why I have to reproduce all of this.
ghc-options:
Arbitrary(..),
Gen,
Property,
- choose)
+ choose,
+ vectorOf)
import Assertions (assertAlmostEqual, assertTrue)
import Comparisons ((~=))
import Cube (Cube(Cube),
instance Arbitrary Grid where
arbitrary = do
- fvs <- arbitrary :: Gen Values3D
+ x_dim <- choose (1, 27)
+ y_dim <- choose (1, 27)
+ z_dim <- choose (1, 27)
+ elements <- vectorOf (x_dim * y_dim * z_dim) (arbitrary :: Gen Double)
+ let new_shape = (R.Z R.:. x_dim R.:. y_dim R.:. z_dim)
+ let fvs = R.fromListUnboxed new_shape elements
return $ Grid fvs
)
import System.FilePath ()
-import Test.QuickCheck (Arbitrary(..), Gen, choose, vectorOf)
-
import ScaleFactor (ScaleFactor)
type Values3D = Values DIM3
-instance Arbitrary Values3D where
- arbitrary = do
- -- I declare not to care about empty lists.
- x_dim <- choose (1, 27)
- y_dim <- choose (1, 27)
- z_dim <- choose (1, 27)
- elements <- vectorOf (x_dim * y_dim * z_dim) (arbitrary :: Gen Double)
- let new_shape = (Z :. x_dim :. y_dim :. z_dim)
- let three_d = Data.Array.Repa.fromListUnboxed new_shape elements
- return three_d
-
-
empty3d :: Values3D
empty3d = Data.Array.Repa.fromListUnboxed (Z :. 0 :. 0 :. 0) []
defaultMainWithOpts tests my_runner_opts
--- | Defined so that my test names fit on one line.
-tc :: Test.Framework.Providers.API.TestName -> Test.HUnit.Assertion -> Test.Framework.Test
-tc = testCase
-
-
--- | Defined so that my test names fit on one line.
-tp :: Test.QuickCheck.Testable a => Test.Framework.TestName -> a -> Test.Framework.Test
-tp = testProperty
-
-
tests :: [Test.Framework.Test]
tests = [ cardinal_tests,
function_values_tests,
tetrahedron_tests,
cube_properties,
tetrahedron_properties,
- misc_properties,
+ misc_properties,
cardinal_properties,
slow_tests ]