Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added specs for some conversions in Astrodynamics.

  • Loading branch information...
commit 75e6f659329883865a655ced9d33b04a6d16d3a7 1 parent 1376074
@bjornbm authored
Showing with 41 additions and 0 deletions.
  1. +41 −0 test/AstrodynamicsSpec.hs
View
41 test/AstrodynamicsSpec.hs
@@ -0,0 +1,41 @@
+{-# 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
+ spec_driftRateToSMA
+ spec_meanAngularMotion
+
+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"
+ a ~== semiMajorAxis (meanAngularMotion a))
+ (property $ \(NonNegativeD (a::Length Double)) ->
Please sign in to comment.
Something went wrong with that request. Please try again.