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.
cube_properties :: Test.Framework.Test
cube_properties =
testGroup "Cube Properties" [
+ tp "front/back tetrahedra are disjoint" prop_front_back_tetrahedra_disjoint,
+ tp "top/down tetrahedra are disjoint" prop_top_down_tetrahedra_disjoint,
+ tp "left/right tetrahedra are disjoint" prop_left_right_tetrahedra_disjoint,
tp "all volumes positive" prop_all_volumes_positive,
tp "all volumes exact" prop_all_volumes_exact,
tp "v0 all equal" prop_v0_all_equal,