X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTetrahedron.hs;h=4bc86581bf0491cf7d8a66bfbcf7f019b66aa3b7;hb=f10cdab8ffeb93b3d36fe8140321c8a94ceb4825;hp=8e9acd38c8b9a0b858f56287fc8aa0c637fd8beb;hpb=d6dd574714648c0703175b5b2d3ccdd5198bb552;p=spline3.git diff --git a/src/Tetrahedron.hs b/src/Tetrahedron.hs index 8e9acd3..4bc8658 100644 --- a/src/Tetrahedron.hs +++ b/src/Tetrahedron.hs @@ -16,16 +16,19 @@ where import Data.Vector ( singleton, snoc ) import qualified Data.Vector as V ( sum ) -import Test.Framework ( Test, testGroup ) -import Test.Framework.Providers.HUnit ( testCase ) -import Test.Framework.Providers.QuickCheck2 ( testProperty ) -import Test.HUnit (Assertion, assertEqual) -import Test.QuickCheck ( Arbitrary(..), Gen, Property, (==>) ) +import Test.Tasty ( TestTree, testGroup ) +import Test.Tasty.HUnit ( Assertion, assertEqual, testCase ) +import Test.Tasty.QuickCheck ( + Arbitrary( arbitrary ), + Gen, + Property, + (==>), + testProperty ) import Comparisons ( (~=) ) import FunctionValues ( FunctionValues(..), empty_values ) import Misc ( factorial ) -import Point ( Point(..), scale ) +import Point ( Point(Point), scale ) import RealFunction ( RealFunction, cmult, fexp ) data Tetrahedron = @@ -104,7 +107,7 @@ beta t i j k l = coefficient `cmult` (b0_term * b1_term * b2_term * b3_term) where denominator = (factorial i)*(factorial j)*(factorial k)*(factorial l) - coefficient = 6 / (fromIntegral denominator) + coefficient = (6 / (fromIntegral denominator)) :: Double b0_term = (b0 t) `fexp` i b1_term = (b1 t) `fexp` j b2_term = (b2 t) `fexp` k @@ -321,7 +324,7 @@ b3 t point = (volume inner_tetrahedron) / (precomputed_volume t) -- | Check the volume of a particular tetrahedron (computed by hand) -- Its vertices are in clockwise order, so the volume should be -- negative. -tetrahedron1_geometry_tests :: Test.Framework.Test +tetrahedron1_geometry_tests :: TestTree tetrahedron1_geometry_tests = testGroup "tetrahedron1 geometry" [ testCase "volume1" volume1 ] @@ -347,7 +350,7 @@ tetrahedron1_geometry_tests = -- | Check the volume of a particular tetrahedron (computed by hand) -- Its vertices are in counter-clockwise order, so the volume should -- be positive. -tetrahedron2_geometry_tests :: Test.Framework.Test +tetrahedron2_geometry_tests :: TestTree tetrahedron2_geometry_tests = testGroup "tetrahedron2 geometry" [ testCase "volume1" volume1 ] @@ -494,17 +497,17 @@ prop_swapping_vertices_doesnt_affect_coefficients4 t = -tetrahedron_tests :: Test.Framework.Test +tetrahedron_tests :: TestTree tetrahedron_tests = - testGroup "Tetrahedron Tests" [ + testGroup "Tetrahedron tests" [ tetrahedron1_geometry_tests, tetrahedron2_geometry_tests ] -p78_24_properties :: Test.Framework.Test +p78_24_properties :: TestTree p78_24_properties = - testGroup "p. 78, Section (2.4) Properties" [ + testGroup "p. 78, Section (2.4) properties" [ testProperty "c3000 identity" prop_c3000_identity, testProperty "c2100 identity" prop_c2100_identity, testProperty "c1110 identity" prop_c1110_identity] @@ -556,9 +559,9 @@ p78_24_properties = -tetrahedron_properties :: Test.Framework.Test +tetrahedron_properties :: TestTree tetrahedron_properties = - testGroup "Tetrahedron Properties" [ + testGroup "Tetrahedron properties" [ p78_24_properties, testProperty "b0_v0_always_unity" prop_b0_v0_always_unity, testProperty "b0_v1_always_zero" prop_b0_v1_always_zero,