From 90702e6469e7542acafb3ea836bad61f94af9fd0 Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 17 Dec 2014 22:27:29 +0100 Subject: [PATCH] TESTS: make getAngleProp6 more useful by testing commutative property --- Test/Vector.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Test/Vector.hs b/Test/Vector.hs index 55f62a7..0f5bd93 100644 --- a/Test/Vector.hs +++ b/Test/Vector.hs @@ -97,9 +97,10 @@ getAngleProp5 (Positive (R2 x1 _)) (Positive (R2 _ y2)) = getAngle (R2 x1 0) (R2 0 y2) == pi / 2 +-- commutative getAngleProp6 :: Positive Vec -> Positive Vec -> Bool -getAngleProp6 (Positive (R2 _ y1)) (Positive (R2 x2 _)) - = getAngle (R2 0 y1) (R2 x2 0) == pi / 2 +getAngleProp6 (Positive v1) (Positive v2) + = getAngle v1 v2 == getAngle v2 v1 -- commutative