X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FGrid.hs;h=f9a59729554a9f12d72d9e384f332e024e858bdc;hb=a499efdb0e215ac424fe7c38a52430daebefc22b;hp=b40f6558453e619ebae33f505eb4d5737bbb5b62;hpb=5de566481cadea0f1e258657ee2697ad643b77d5;p=spline3.git diff --git a/src/Grid.hs b/src/Grid.hs index b40f655..f9a5972 100644 --- a/src/Grid.hs +++ b/src/Grid.hs @@ -3,6 +3,7 @@ -- function used to build the interpolation. module Grid ( cube_at, + grid_properties, grid_tests, slow_tests, zoom ) @@ -15,17 +16,17 @@ import Data.Array.Repa ( computeUnboxedP, fromListUnboxed ) import Data.Array.Repa.Operators.Traversal ( unsafeTraverse ) -import Test.HUnit ( Assertion, assertEqual ) -import Test.Framework ( Test, testGroup ) -import Test.Framework.Providers.HUnit ( testCase ) -import Test.Framework.Providers.QuickCheck2 ( testProperty ) -import Test.QuickCheck ( - (==>), +import Test.Tasty ( TestTree, testGroup ) +import Test.Tasty.HUnit ( Assertion, assertEqual, testCase ) +import Test.Tasty.QuickCheck ( Arbitrary(..), Gen, Property, + (==>), choose, - vectorOf ) + vectorOf, + testProperty ) + import Assertions ( assertAlmostEqual, assertTrue ) import Comparisons ( (~=) ) import Cube ( @@ -38,7 +39,7 @@ import FunctionValues ( make_values, value_at ) import Point ( Point(..) ) import ScaleFactor ( ScaleFactor ) import Tetrahedron ( - Tetrahedron(v0,v1,v2,v3), + Tetrahedron( v0, v1, v2, v3 ), c, polynomial ) import Values ( Values3D, dims, empty3d, zoom_shape ) @@ -152,7 +153,7 @@ zoom v3d scale_factor -- We also verify that the four vertices on face0 of the cube are -- in the correct location. -- -trilinear_c0_t0_tests :: Test.Framework.Test +trilinear_c0_t0_tests :: TestTree trilinear_c0_t0_tests = testGroup "trilinear c0 t0" [testGroup "coefficients" @@ -462,9 +463,9 @@ prop_c0300_identity g = -- | All of the properties from Section (2.9), p. 80. These require a -- grid since they refer to two adjacent cubes. -p80_29_properties :: Test.Framework.Test +p80_29_properties :: TestTree p80_29_properties = - testGroup "p. 80, Section (2.9) Properties" [ + testGroup "p. 80, Section (2.9) properties" [ testProperty "c0120 identity" prop_c0120_identity, testProperty "c0111 identity" prop_c0111_identity, testProperty "c0201 identity" prop_c0201_identity, @@ -473,19 +474,22 @@ p80_29_properties = testProperty "c0300 identity" prop_c0300_identity ] -grid_tests :: Test.Framework.Test +grid_tests :: TestTree grid_tests = - testGroup "Grid Tests" [ - trilinear_c0_t0_tests, - p80_29_properties, - testProperty "cube indices within bounds" - prop_cube_indices_never_go_out_of_bounds ] + testGroup "Grid tests" [ trilinear_c0_t0_tests ] + +grid_properties :: TestTree +grid_properties = + testGroup "Grid properties" + [ p80_29_properties, + testProperty "cube indices within bounds" + prop_cube_indices_never_go_out_of_bounds ] -- Do the slow tests last so we can stop paying attention. -slow_tests :: Test.Framework.Test +slow_tests :: TestTree slow_tests = - testGroup "Slow Tests" [ + testGroup "Slow tests" [ testCase "trilinear reproduced" test_trilinear_reproduced, testCase "trilinear9x9x9 reproduced" test_trilinear9x9x9_reproduced, testCase "zeros reproduced" test_zeros_reproduced ]