Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (28 sloc) 1011 Bytes
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RecordWildCards #-}
module AstrodynamicsSpec where
import Test.Hspec
import Test.QuickCheck (property, (==>))
import Data.AEq
import TestUtil
import TestInstances
import Numeric.Units.Dimensional.Prelude
import qualified Prelude
import Astrodynamics
main = hspec spec
spec = do
spec_driftRateToPeriod = describe "driftRateToPeriod" $ do
it "is the inverse of periodToDriftRate"
(property $ \(d::AngularVelocity Double) ->
d ~== periodToDriftRate (driftRateToPeriod d))
spec_driftRateToSMA = describe "smaToDriftRate" $ do
it "is the inverse of driftRateToSMA"
(property $ \(NonNegativeD (a::Length Double)) ->
a ~== driftRateToSMA (smaToDriftRate a))
spec_meanAngularMotion = describe "meanAngularMotion" $ do
it "is the inverse of semiMajorAxis"
(property $ \(NonNegativeD (a::Length Double)) ->
a ~== semiMajorAxis (meanAngularMotion a))