From: Michael Orlitzky Date: Tue, 14 Jun 2011 15:39:37 +0000 (-0400) Subject: Add four tests confirming that vertex swaps don't affect coefficients. X-Git-Tag: 0.0.1~276 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=spline3.git;a=commitdiff_plain;h=5c567a139aa16a7df3b4279b13d3110027eb744f Add four tests confirming that vertex swaps don't affect coefficients. --- diff --git a/src/Tests/Tetrahedron.hs b/src/Tests/Tetrahedron.hs index 159acd7..1ec4c8e 100644 --- a/src/Tests/Tetrahedron.hs +++ b/src/Tests/Tetrahedron.hs @@ -366,3 +366,27 @@ prop_z_rotation_doesnt_affect_top t = fv1 = rotate (Tetrahedron.fv t) cwz expr1 = top $ fv0 expr2 = top $ fv1 + +prop_swapping_vertices_doesnt_affect_coefficients1 :: Tetrahedron -> Bool +prop_swapping_vertices_doesnt_affect_coefficients1 t = + c t 0 0 1 2 == c t' 0 0 1 2 + where + t' = t { v0 = (v1 t), v1 = (v0 t) } + +prop_swapping_vertices_doesnt_affect_coefficients2 :: Tetrahedron -> Bool +prop_swapping_vertices_doesnt_affect_coefficients2 t = + c t 0 1 1 1 == c t' 0 1 1 1 + where + t' = t { v2 = (v3 t), v3 = (v2 t) } + +prop_swapping_vertices_doesnt_affect_coefficients3 :: Tetrahedron -> Bool +prop_swapping_vertices_doesnt_affect_coefficients3 t = + c t 2 1 0 0 == c t' 2 1 0 0 + where + t' = t { v2 = (v3 t), v3 = (v2 t) } + +prop_swapping_vertices_doesnt_affect_coefficients4 :: Tetrahedron -> Bool +prop_swapping_vertices_doesnt_affect_coefficients4 t = + c t 2 0 0 1 == c t' 2 0 0 1 + where + t' = t { v0 = (v3 t), v3 = (v0 t) } diff --git a/test/TestSuite.hs b/test/TestSuite.hs index 2f2cc76..f97df52 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -416,6 +416,18 @@ main = do putStr "prop_b3_v2_always_zero... " quickCheckWith qc_args prop_b3_v2_always_zero + putStr "prop_swapping_vertices_doesnt_affect_coefficients1... " + quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients1 + + putStr "prop_swapping_vertices_doesnt_affect_coefficients2... " + quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients2 + + putStr "prop_swapping_vertices_doesnt_affect_coefficients3... " + quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients3 + + putStr "prop_swapping_vertices_doesnt_affect_coefficients4... " + quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients4 + putStrLn "\np. 78, (2.4)\n" putStr "prop_c3000_identity... " @@ -427,7 +439,6 @@ main = do putStr "prop_c1110_identity... " quickCheckWith qc_args TT.prop_c1110_identity - putStrLn "\nCardinal Tests\n" putStr "prop_ccwx_rotation_changes_direction... "