packages feed

diagrams-lib-1.4.2.3 / test / Diagrams / Test / Angle.hs

-- |module Diagrams.Test.Angle whereimport           Test.Tastyimport           Test.Tasty.QuickCheckimport           Diagrams.Preludeimport Instancestests :: TestTreetests = testGroup "Angle" [         testProperty "2π radians per turn" $           \θ -> θ^.rad =~ θ^.turn*2*(pi :: Double)         , testProperty "360 degrees per turn" $           \θ -> θ^.deg =~ θ^.turn*(360 :: Double)         , testProperty "Angle vector addition is commutative" $           \θ φ -> (θ :: Angle Double) ^+^ φ =~ φ ^+^ θ         , testProperty "Angle subtraction is the inverse of addition" $           \θ φ -> (θ :: Angle Double) ^+^ φ ^-^ φ =~ θ         , testProperty "Angle vector negation squared is identity" $           \θ -> negated (negated (θ :: Angle Double)) =~ θ         , testProperty "A negated angle is the additive inverse of the original" $           \θ -> (θ :: Angle Double) ^+^ (negated θ) =~ 0@@turn         , testProperty "A negated angle is the additive inverse of the original" $           \θ -> (θ :: Angle Double) ^+^ (negated θ) =~ 0@@turn      ]