geom2d-0.2.1: Test/Distance.hs
{-# LANGUAGE TemplateHaskell #-}
import Data.AEq
import Geom2d.Distance
import Geom2d.Point
import Linear.V2
import Test.QuickCheck
import Test.Utils
prop_distance_point_point :: Point' Float -> Point' Float -> Bool
prop_distance_point_point p q =
distance p q ~==
sqrt ( (x p - x q)^(2::Int) + (y p - y q)^(2::Int) )
prop_distance_v2 :: V2 Float -> V2 Float -> Bool
prop_distance_v2 p q =
distance p q ~==
sqrt ( (x p - x q)^2 + (y p - y q)^2 )
return []
runTests = $quickCheckAll
main :: IO ()
main = do
putStrLn "Test Distance"
runTests >>= doExit