From b0ac57ff4533f2d7120f04ba6f24a73afaf7902a Mon Sep 17 00:00:00 2001 From: stla Date: Sun, 21 Apr 2024 16:21:24 +0200 Subject: [PATCH] unit test --- hspray.cabal | 1 + tests/Main.hs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hspray.cabal b/hspray.cabal index 5aa79eb..64da16c 100644 --- a/hspray.cabal +++ b/hspray.cabal @@ -54,6 +54,7 @@ test-suite unit-tests , tasty-hunit >= 0.10 && < 0.11 , numeric-prelude >= 0.4.4 && < 0.5 , matrix >= 0.3.6.0 && < 0.4 + , unordered-containers >= 0.2.17.0 && < 0.3 , hspray Default-Language: Haskell2010 ghc-options: -Wall diff --git a/tests/Main.hs b/tests/Main.hs index 4c45d1b..76b09ae 100644 --- a/tests/Main.hs +++ b/tests/Main.hs @@ -4,6 +4,7 @@ import qualified Algebra.Module as AlgMod import qualified Algebra.Ring as AlgRing import qualified Algebra.Field as AlgField import Approx ( approx, assertApproxEqual ) +import qualified Data.HashMap.Strict as HM import Data.Matrix ( Matrix, fromLists ) import Data.Maybe ( fromJust ) import Data.Ratio ( (%) ) @@ -91,7 +92,8 @@ import Math.Algebra.Hspray ( Spray, evalParametricSpray, asSimpleParametricSpray, parametricSprayToOneParameterSpray, - prettyParametricQSprayABCXYZ + prettyParametricQSprayABCXYZ, + asSimpleParametricSpray ) import MathObj.Matrix ( fromRows ) import qualified MathObj.Matrix as MathMatrix @@ -113,7 +115,14 @@ main = defaultMain $ testGroup "Testing hspray" [ - testCase "prettyParametricQSprayABCXYZ" $ do + testCase "asSimpleParametricSpray" $ do + let + jp = jacobiPolynomial 8 + jp' = asSimpleParametricSpray jp + jp'' = HM.map asRatioOfSprays jp' + assertEqual "" jp jp'' + + , testCase "prettyParametricQSprayABCXYZ" $ do let f :: (QSpray, QSpray) -> (PQS, PQS, PQS) -> PQS f (a, b) (x, y, z) =