X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTests%2FCube.hs;h=0a1cc504179e9e0c7a79dae01c8ced961ac8b434;hb=86d39fb9ddd83414f4b896bea89404e9786ff0d0;hp=15103ce190019f3cee2feb006ded3690131924f3;hpb=41ad17ad9670eb529549c50d528e59407f438e5c;p=spline3.git diff --git a/src/Tests/Cube.hs b/src/Tests/Cube.hs index 15103ce..0a1cc50 100644 --- a/src/Tests/Cube.hs +++ b/src/Tests/Cube.hs @@ -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.