Skip to content

Commit

Permalink
use Double in tests instead of Float
Browse files Browse the repository at this point in the history
See #281.
  • Loading branch information
byorgey committed Aug 5, 2016
1 parent eb619fa commit c05fda2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/Diagrams/Test/Direction.hs
Expand Up @@ -3,11 +3,11 @@
module Diagrams.Test.Direction where


import Diagrams.Direction
import Diagrams.Prelude
import Instances
import Test.Tasty
import Test.Tasty.QuickCheck
import Diagrams.Prelude
import Diagrams.Direction
import Instances

tests :: TestTree
tests = testGroup "Direction" [
Expand All @@ -16,9 +16,9 @@ tests = testGroup "Direction" [
, testProperty "HasTheta subtraction yeilds same result as anglebetween" $
(anglebetsub)
, testProperty "anglebetweenDirs is commutative" $
\a b -> angleBetweenDirs (a :: Direction V2 Float) b =~ angleBetweenDirs b a
\a b -> angleBetweenDirs (a :: Direction V2 Double) b =~ angleBetweenDirs b a
, testProperty "fromdirection does not effect angleBetweenDirs" $
\a b -> angleBetween (fromDirection (a :: Direction V2 Float)) (fromDirection b) =~ angleBetweenDirs a b
\a b -> angleBetween (fromDirection (a :: Direction V2 Double)) (fromDirection b) =~ angleBetweenDirs a b



Expand All @@ -28,7 +28,7 @@ if' :: Bool -> a -> a -> a
if' True x _ = x
if' False _ y = y

anglebetsub :: Direction V2 Float -> Direction V2 Float -> Bool
anglebetsub :: Direction V2 Double -> Direction V2 Double -> Bool
anglebetsub a b = (if' (abs (a ^. _theta^.rad - b ^. _theta^.rad) < pi)
(abs ((a ^. _theta ^-^ b ^. _theta)^.rad))
(2*pi - abs (a ^. _theta^.rad - b ^. _theta^.rad) ) =~ angleBetweenDirs a b ^.rad)

0 comments on commit c05fda2

Please sign in to comment.