]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tests/Cube.hs
Add tests for some functions used in the new 'find_containing_tetrahedron'.
[spline3.git] / src / Tests / Cube.hs
index 15103ce190019f3cee2feb006ded3690131924f3..0a1cc504179e9e0c7a79dae01c8ced961ac8b434 100644 (file)
@@ -7,15 +7,35 @@ import Cardinal
 import Comparisons
 import Cube hiding (i, j, k)
 import FunctionValues
-import Misc (all_equal)
+import Misc (all_equal, disjoint)
 import Tests.FunctionValues ()
 import Tetrahedron (b0, b1, b2, b3, c, fv,
                     v0, v1, v2, v3, volume)
 
 
-
 -- Quickcheck tests.
 
+-- | The 'front_half_tetrahedra' and 'back_half_tetrahedra' should
+--   have no tetrahedra in common.
+prop_front_back_tetrahedra_disjoint :: Cube -> Bool
+prop_front_back_tetrahedra_disjoint c =
+    disjoint (front_half_tetrahedra c) (back_half_tetrahedra c)
+
+
+-- | The 'top_half_tetrahedra' and 'down_half_tetrahedra' should
+--   have no tetrahedra in common.
+prop_top_down_tetrahedra_disjoint :: Cube -> Bool
+prop_top_down_tetrahedra_disjoint c =
+    disjoint (top_half_tetrahedra c) (down_half_tetrahedra c)
+
+
+-- | The 'left_half_tetrahedra' and 'right_half_tetrahedra' should
+--   have no tetrahedra in common.
+prop_left_right_tetrahedra_disjoint :: Cube -> Bool
+prop_left_right_tetrahedra_disjoint c =
+    disjoint (left_half_tetrahedra c) (right_half_tetrahedra c)
+
+
 -- | Since the grid size is necessarily positive, all tetrahedra
 --   (which comprise cubes of positive volume) must have positive volume
 --   as well.