]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - test/TestSuite.hs
Fix many of the tests from page 79.
[spline3.git] / test / TestSuite.hs
index ce386dbd754757e36842fa97c46a7102532c61ca..2f2cc76d93fd0fdf18a469846ec286944bfd4777 100644 (file)
@@ -2,13 +2,16 @@ import Test.HUnit
 import Test.QuickCheck
 
 import Tests.Cardinal
-import Tests.Cube
+import Tests.Cube as TC
+import Tests.FunctionValues
 import Tests.Grid
 import Tests.Misc
 import Tests.Tetrahedron as TT
 
 -- The list of HUnit tests.
-test_suite = TestList (concat [grid_tests,
+test_suite = TestList (concat [cardinal_tests,
+                               function_values_tests,
+                               grid_tests,
                                misc_tests,
                                tetrahedron_tests])
 
@@ -29,38 +32,83 @@ main = do
 
   putStrLn "\nCube Tests\n"
 
-  -- putStr "prop_c0120_identity1... "
-  -- quickCheckWith qc_args prop_c0120_identity1
-
   putStr "prop_all_volumes_positive... "
   quickCheckWith qc_args prop_all_volumes_positive
 
-  -- putStr "prop_tetrahedron0_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron0_volumes_exact
+  putStr "prop_tetrahedron0_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron0_volumes_exact
+
+  putStr "prop_tetrahedron1_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron1_volumes_exact
+
+  putStr "prop_tetrahedron2_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron2_volumes_exact
+
+  putStr "prop_tetrahedron3_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron3_volumes_exact
+
+  putStr "prop_tetrahedron4_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron4_volumes_exact
+
+  putStr "prop_tetrahedron4_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron4_volumes_exact
+
+  putStr "prop_tetrahedron5_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron5_volumes_exact
+
+  putStr "prop_tetrahedron6_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron6_volumes_exact
+
+  putStr "prop_tetrahedron7_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron7_volumes_exact
+
+  putStr "prop_tetrahedron8_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron8_volumes_exact
+
+  putStr "prop_tetrahedron9_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron9_volumes_exact
+
+  putStr "prop_tetrahedron10_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron10_volumes_exact
+
+  putStr "prop_tetrahedron11_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron11_volumes_exact
+
+  putStr "prop_tetrahedron12_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron12_volumes_exact
+
+  putStr "prop_tetrahedron13_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron13_volumes_exact
+
+  putStr "prop_tetrahedron14_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron14_volumes_exact
+
+  putStr "prop_tetrahedron15_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron15_volumes_exact
 
-  -- putStr "prop_tetrahedron1_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron1_volumes_exact
+  putStr "prop_tetrahedron16_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron16_volumes_exact
 
-  -- putStr "prop_tetrahedron2_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron2_volumes_exact
+  putStr "prop_tetrahedron17_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron17_volumes_exact
 
-  -- putStr "prop_tetrahedron3_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron3_volumes_exact
+  putStr "prop_tetrahedron18_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron18_volumes_exact
 
-  -- putStr "prop_tetrahedron4_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron4_volumes_exact
+  putStr "prop_tetrahedron19_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron19_volumes_exact
 
-  -- putStr "prop_tetrahedron4_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron4_volumes_exact
+  putStr "prop_tetrahedron20_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron20_volumes_exact
 
-  -- putStr "prop_tetrahedron5_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron5_volumes_exact
+  putStr "prop_tetrahedron21_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron21_volumes_exact
 
-  -- putStr "prop_tetrahedron6_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron6_volumes_exact
+  putStr "prop_tetrahedron22_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron22_volumes_exact
 
-  -- putStr "prop_tetrahedron7_volumes_exact... "
-  -- quickCheckWith qc_args prop_tetrahedron7_volumes_exact
+  putStr "prop_tetrahedron23_volumes_exact... "
+  quickCheckWith qc_args prop_tetrahedron23_volumes_exact
 
   putStr "prop_tetrahedron0_volumes_positive... "
   quickCheckWith qc_args prop_tetrahedron0_volumes_positive
@@ -137,11 +185,181 @@ main = do
   putStr "prop_v0_all_equal... "
   quickCheckWith qc_args prop_v0_all_equal
 
---  putStrLn "\np. 78, (2.5)\n"
+  -- putStrLn "\np. 78, (2.5)\n"
+
+  -- putStr "prop_cijk1_identity... "
+  -- quickCheckWith qc_args prop_cijk1_identity
+
+
+  putStrLn "\np. 79, (2.6)\n"
+
+  putStr "prop_c0120_identity1... "
+  quickCheckWith qc_args TC.prop_c0120_identity1
+
+  putStr "prop_c0120_identity2... "
+  quickCheckWith qc_args TC.prop_c0120_identity2
+
+  putStr "prop_c0120_identity3... "
+  quickCheckWith qc_args TC.prop_c0120_identity3
+
+  -- putStr "prop_c0120_identity4... "
+  -- quickCheckWith qc_args TC.prop_c0120_identity4
+
+  -- putStr "prop_c0120_identity5... "
+  -- quickCheckWith qc_args TC.prop_c0120_identity5
+
+  -- putStr "prop_c0120_identity6... "
+  -- quickCheckWith qc_args TC.prop_c0120_identity6
+
+  putStr "prop_c0210_identity1... "
+  quickCheckWith qc_args TC.prop_c0210_identity1
+
+  putStr "prop_c0300_identity1... "
+  quickCheckWith qc_args TC.prop_c0300_identity1
+
+  putStr "prop_c1110_identity... "
+  quickCheckWith qc_args TC.prop_c1110_identity
+
+  putStr "prop_c1200_identity1... "
+  quickCheckWith qc_args TC.prop_c1200_identity1
+
+  putStr "prop_c2100_identity1... "
+  quickCheckWith qc_args TC.prop_c2100_identity1
+
+  putStrLn "\np. 79, (2.7)\n"
+
+  putStr "prop_c0102_identity1... "
+  quickCheckWith qc_args TC.prop_c0102_identity1
+
+  putStr "prop_c0201_identity1... "
+  quickCheckWith qc_args TC.prop_c0201_identity1
+
+  putStr "prop_c0300_identity2... "
+  quickCheckWith qc_args TC.prop_c0300_identity2
+
+  putStr "prop_c1101_identity... "
+  quickCheckWith qc_args TC.prop_c1101_identity
+
+  putStr "prop_c1200_identity2... "
+  quickCheckWith qc_args TC.prop_c1200_identity2
+
+  putStr "prop_c2100_identity2... "
+  quickCheckWith qc_args TC.prop_c2100_identity2
+
+  putStrLn "\np. 79, (2.8)\n"
+
+  putStr "prop_c3000_identity... "
+  quickCheckWith qc_args TC.prop_c3000_identity
+
+  putStr "prop_c2010_identity... "
+  quickCheckWith qc_args TC.prop_c2010_identity
+
+  putStr "prop_c2001_identity... "
+  quickCheckWith qc_args TC.prop_c2001_identity
+
+  putStr "prop_c1020_identity... "
+  quickCheckWith qc_args TC.prop_c1020_identity
+
+  putStr "prop_c1002_identity... "
+  quickCheckWith qc_args TC.prop_c1002_identity
+
+  putStr "prop_c1011_identity... "
+  quickCheckWith qc_args TC.prop_c1011_identity
+
+  -- putStrLn "\np. 80, (2.9)\n"
+
+  -- putStr "prop_c0120_identity2... "
+  -- quickCheckWith qc_args TF.prop_c0120_identity2
+
+  -- putStr "prop_c0102_identity2... "
+  -- quickCheckWith qc_args TF.prop_c0102_identity2
+
+  -- putStr "prop_c0111_identity... "
+  -- quickCheckWith qc_args TF.prop_c0111_identity
+
+  -- putStr "prop_c0210_identity2... "
+  -- quickCheckWith qc_args TF.prop_c0210_identity2
+
+  -- putStr "prop_c0201_identity2... "
+  -- quickCheckWith qc_args TF.prop_c0201_identity2
+
+  -- putStr "prop_c0300_identity3... "
+  -- quickCheckWith qc_args TF.prop_c0300_identity3
+
+  putStr "prop_interior_values_all_identical... "
+  quickCheckWith qc_args prop_interior_values_all_identical
+
+  putStr "prop_c_tilde_2100_rotation_correct... "
+  quickCheckWith qc_args prop_c_tilde_2100_rotation_correct
+
+  putStr "prop_x_rotation_doesnt_affect_front... "
+  quickCheckWith qc_args prop_x_rotation_doesnt_affect_front
+
+  putStr "prop_x_rotation_doesnt_affect_back... "
+  quickCheckWith qc_args prop_x_rotation_doesnt_affect_back
+
+  putStr "prop_y_rotation_doesnt_affect_left... "
+  quickCheckWith qc_args prop_y_rotation_doesnt_affect_left
+
+  putStr "prop_y_rotation_doesnt_affect_right... "
+  quickCheckWith qc_args prop_y_rotation_doesnt_affect_right
+
+  putStr "prop_z_rotation_doesnt_affect_top... "
+  quickCheckWith qc_args prop_z_rotation_doesnt_affect_top
+
+  putStr "prop_z_rotation_doesnt_affect_down... "
+  quickCheckWith qc_args prop_z_rotation_doesnt_affect_down
+
+  putStr "prop_c_tilde_2100_correct... "
+  quickCheckWith qc_args prop_c_tilde_2100_correct
+
+
+  putStrLn "\nEdge Incidence Tests\n"
+
+  putStr "prop_t0_shares_edge_with_t6... "
+  quickCheckWith qc_args prop_t0_shares_edge_with_t6
+
+  putStr "prop_t0_shares_edge_with_t1... "
+  quickCheckWith qc_args prop_t0_shares_edge_with_t1
+
+  putStr "prop_t0_shares_edge_with_t3... "
+  quickCheckWith qc_args prop_t0_shares_edge_with_t3
+
+  putStr "prop_t1_shares_edge_with_t2... "
+  quickCheckWith qc_args prop_t1_shares_edge_with_t2
 
---  putStr "prop_cijk1_identity... "
---  quickCheckWith qc_args prop_cijk1_identity
+  putStr "prop_t1_shares_edge_with_t19... "
+  quickCheckWith qc_args prop_t1_shares_edge_with_t19
 
+  putStr "prop_t2_shares_edge_with_t3... "
+  quickCheckWith qc_args prop_t2_shares_edge_with_t3
+
+  putStr "prop_t2_shares_edge_with_t12... "
+  quickCheckWith qc_args prop_t2_shares_edge_with_t12
+
+  putStr "prop_t3_shares_edge_with_t21... "
+  quickCheckWith qc_args prop_t3_shares_edge_with_t21
+
+  putStr "prop_t4_shares_edge_with_t5... "
+  quickCheckWith qc_args prop_t4_shares_edge_with_t5
+
+  putStr "prop_t4_shares_edge_with_t7... "
+  quickCheckWith qc_args prop_t4_shares_edge_with_t7
+
+  putStr "prop_t4_shares_edge_with_t10... "
+  quickCheckWith qc_args prop_t4_shares_edge_with_t10
+
+  putStr "prop_t5_shares_edge_with_t6... "
+  quickCheckWith qc_args prop_t5_shares_edge_with_t6
+
+  putStr "prop_t5_shares_edge_with_t16... "
+  quickCheckWith qc_args prop_t5_shares_edge_with_t16
+
+  putStr "prop_t6_shares_edge_with_t7... "
+  quickCheckWith qc_args prop_t6_shares_edge_with_t7
+
+  putStr "prop_t7_shares_edge_with_t20... "
+  quickCheckWith qc_args prop_t7_shares_edge_with_t20
 
   putStrLn "\nMisc Tests\n"
 
@@ -209,90 +427,44 @@ main = do
   putStr "prop_c1110_identity... "
   quickCheckWith qc_args TT.prop_c1110_identity
 
-  -- putStrLn "\np. 79, (2.6)\n"
-
-  -- putStr "prop_c0210_identity1... "
-  -- quickCheckWith qc_args TF.prop_c0210_identity1
-
-  -- putStr "prop_c0300_identity1... "
-  -- quickCheckWith qc_args TF.prop_c0300_identity1
-
-  -- putStr "prop_c1110_identity... "
-  -- quickCheckWith qc_args TF.prop_c1110_identity
-
-  -- putStr "prop_c1200_identity1... "
-  -- quickCheckWith qc_args prop_c1200_identity1
-
-  -- putStr "prop_c2100_identity1... "
-  -- quickCheckWith qc_args TF.prop_c2100_identity1
-
-  -- putStrLn "\np. 79, (2.7)\n"
-
-  -- putStr "prop_c0102_identity1... "
-  -- quickCheckWith qc_args TF.prop_c0102_identity1
 
-  -- putStr "prop_c0201_identity1... "
-  -- quickCheckWith qc_args TF.prop_c0201_identity1
-
-  -- putStr "prop_c0300_identity2... "
-  -- quickCheckWith qc_args TF.prop_c0300_identity2
-
-  -- putStr "prop_c1101_identity... "
-  -- quickCheckWith qc_args TF.prop_c1101_identity
-
-  -- putStr "prop_c1200_identity2... "
-  -- quickCheckWith qc_args TF.prop_c1200_identity2
-
-  -- putStr "prop_c2100_identity2... "
-  -- quickCheckWith qc_args TF.prop_c2100_identity2
-
-  -- putStrLn "\np. 79, (2.8)\n"
-
-  -- putStr "prop_c3000_identity... "
-  -- quickCheckWith qc_args TF.prop_c3000_identity
-
-  -- putStr "prop_c2010_identity... "
-  -- quickCheckWith qc_args TF.prop_c2010_identity
-
-  -- putStr "prop_c2001_identity... "
-  -- quickCheckWith qc_args TF.prop_c2001_identity
-
-  -- putStr "prop_c1020_identity... "
-  -- quickCheckWith qc_args TF.prop_c1020_identity
+  putStrLn "\nCardinal Tests\n"
 
-  -- putStr "prop_c1002_identity... "
-  -- quickCheckWith qc_args TF.prop_c1002_identity
+  putStr "prop_ccwx_rotation_changes_direction... "
+  quickCheckWith qc_args prop_ccwx_rotation_changes_direction
 
-  -- putStr "prop_c1011_identity... "
-  -- quickCheckWith qc_args TF.prop_c1011_identity
+  putStr "prop_cwx_rotation_changes_direction... "
+  quickCheckWith qc_args prop_cwx_rotation_changes_direction
 
-  -- putStrLn "\np. 80, (2.9)\n"
+  putStr "prop_ccwy_rotation_changes_direction... "
+  quickCheckWith qc_args prop_ccwy_rotation_changes_direction
 
-  -- putStr "prop_c0120_identity2... "
-  -- quickCheckWith qc_args TF.prop_c0120_identity2
+  putStr "prop_cwy_rotation_changes_direction... "
+  quickCheckWith qc_args prop_cwy_rotation_changes_direction
 
-  -- putStr "prop_c0102_identity2... "
-  -- quickCheckWith qc_args TF.prop_c0102_identity2
+  putStr "prop_ccwz_rotation_changes_direction... "
+  quickCheckWith qc_args prop_ccwz_rotation_changes_direction
 
-  -- putStr "prop_c0111_identity... "
-  -- quickCheckWith qc_args TF.prop_c0111_identity
+  putStr "prop_cwz_rotation_changes_direction... "
+  quickCheckWith qc_args prop_cwz_rotation_changes_direction
 
-  -- putStr "prop_c0210_identity2... "
-  -- quickCheckWith qc_args TF.prop_c0210_identity2
+  putStr "prop_ccwx_rotation_result_unique... "
+  quickCheckWith qc_args prop_ccwx_rotation_result_unique
 
-  -- putStr "prop_c0201_identity2... "
-  -- quickCheckWith qc_args TF.prop_c0201_identity2
+  putStr "prop_cwx_rotation_result_unique... "
+  quickCheckWith qc_args prop_cwx_rotation_result_unique
 
-  -- putStr "prop_c0300_identity3... "
-  -- quickCheckWith qc_args TF.prop_c0300_identity3
+  putStr "prop_ccwy_rotation_result_unique... "
+  quickCheckWith qc_args prop_ccwy_rotation_result_unique
 
-  putStrLn "\nCardinal Tests\n"
+  putStr "prop_cwy_rotation_result_unique... "
+  quickCheckWith qc_args prop_cwy_rotation_result_unique
 
-  putStr "prop_ccwx_rotation_changes_direction... "
-  quickCheckWith qc_args prop_ccwx_rotation_changes_direction
+  putStr "prop_ccwz_rotation_result_unique... "
+  quickCheckWith qc_args prop_ccwz_rotation_result_unique
 
-  putStr "prop_cwx_rotation_changes_direction... "
-  quickCheckWith qc_args prop_cwx_rotation_changes_direction
+  putStr "prop_cwz_rotation_result_unique... "
+  quickCheckWith qc_args prop_cwz_rotation_result_unique
 
   putStr "prop_four_cwx_is_identity... "
   quickCheckWith qc_args prop_four_cwx_is_identity