import Test.HUnit
import Test.QuickCheck
+import Cardinal
import Comparisons
import Point
import FunctionValues
term2 = (9/2)*(p t 1 1 1 0)
term3 = (3/4)*((p t 2 1 0 0) + (p t 1 2 0 0) + (p t 2 0 1 0))
term4 = (3/4)*((p t 1 0 2 0) + (p t 0 2 1 0) + (p t 0 1 2 0))
+
+prop_x_rotation_doesnt_affect_front :: Tetrahedron -> Bool
+prop_x_rotation_doesnt_affect_front t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwx
+ expr1 = front $ fv0
+ expr2 = front $ fv1
+
+prop_x_rotation_doesnt_affect_back :: Tetrahedron -> Bool
+prop_x_rotation_doesnt_affect_back t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwx
+ expr1 = back $ fv0
+ expr2 = back $ fv1
+
+
+prop_y_rotation_doesnt_affect_left :: Tetrahedron -> Bool
+prop_y_rotation_doesnt_affect_left t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwy
+ expr1 = left $ fv0
+ expr2 = left $ fv1
+
+prop_y_rotation_doesnt_affect_right :: Tetrahedron -> Bool
+prop_y_rotation_doesnt_affect_right t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwy
+ expr1 = right $ fv0
+ expr2 = right $ fv1
+
+
+prop_z_rotation_doesnt_affect_down :: Tetrahedron -> Bool
+prop_z_rotation_doesnt_affect_down t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwz
+ expr1 = down $ fv0
+ expr2 = down $ fv1
+
+
+prop_z_rotation_doesnt_affect_top :: Tetrahedron -> Bool
+prop_z_rotation_doesnt_affect_top t =
+ expr1 == expr2
+ where
+ fv0 = Tetrahedron.fv t
+ fv1 = rotate (Tetrahedron.fv t) cwz
+ expr1 = top $ fv0
+ expr2 = top $ fv1
putStrLn "prop_c_tilde_2100_rotation_correct... "
quickCheckWith qc_args prop_c_tilde_2100_rotation_correct
+ putStrLn "prop_x_rotation_doesnt_affect_front... "
+ quickCheckWith qc_args prop_x_rotation_doesnt_affect_front
+
+ putStrLn "prop_x_rotation_doesnt_affect_back... "
+ quickCheckWith qc_args prop_x_rotation_doesnt_affect_back
+
+ putStrLn "prop_y_rotation_doesnt_affect_left... "
+ quickCheckWith qc_args prop_y_rotation_doesnt_affect_left
+
+ putStrLn "prop_y_rotation_doesnt_affect_right... "
+ quickCheckWith qc_args prop_y_rotation_doesnt_affect_right
+
+ putStrLn "prop_z_rotation_doesnt_affect_top... "
+ quickCheckWith qc_args prop_z_rotation_doesnt_affect_top
+
+ putStrLn "prop_z_rotation_doesnt_affect_down... "
+ quickCheckWith qc_args prop_z_rotation_doesnt_affect_down
+
putStrLn "prop_c_tilde_2100_correct... "
quickCheckWith qc_args prop_c_tilde_2100_correct