Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Apr 21, 2024
1 parent 86d41b5 commit b0ac57f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions hspray.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( (%) )
Expand Down Expand Up @@ -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
Expand All @@ -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) =
Expand Down

0 comments on commit b0ac57f

Please sign in to comment.