Improve a few Graph test properties
authorGuido Trotter <ultrotter@google.com>
Wed, 12 Dec 2012 14:29:50 +0000 (06:29 -0800)
committerGuido Trotter <ultrotter@google.com>
Fri, 14 Dec 2012 13:11:13 +0000 (14:11 +0100)
Return type is changed from Property to Bool, and the ==? True at the
end is dropped.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

htest/Test/Ganeti/HTools/Graph.hs

index 55ac065..31a619a 100644 (file)
@@ -97,26 +97,24 @@ anyTwo _ [_] = True
 anyTwo op (x:y:xs) = (x `op` y) && anyTwo op (y:xs)
 
 -- | Check order of vertices returned by verticesByDegreeAsc.
-prop_verticesByDegreeAscAsc :: TestableGraph -> Property
-prop_verticesByDegreeAscAsc (TestableGraph g) =
-    anyTwo (<=) (degrees asc) ==? True
+prop_verticesByDegreeAscAsc :: TestableGraph -> Bool
+prop_verticesByDegreeAscAsc (TestableGraph g) = anyTwo (<=) (degrees asc)
     where degrees = map (length . neighbors g)
           asc = verticesByDegreeAsc g
 
 -- | Check order of vertices returned by verticesByDegreeDesc.
-prop_verticesByDegreeDescDesc :: TestableGraph -> Property
-prop_verticesByDegreeDescDesc (TestableGraph g) =
-    anyTwo (>=) (degrees desc) ==? True
+prop_verticesByDegreeDescDesc :: TestableGraph -> Bool
+prop_verticesByDegreeDescDesc (TestableGraph g) = anyTwo (>=) (degrees desc)
     where degrees = map (length . neighbors g)
           desc = verticesByDegreeDesc g
 
 -- | Check that our generated graphs are colorable
-prop_isColorableTestableGraph :: TestableGraph -> Property
-prop_isColorableTestableGraph (TestableGraph g) = isColorable g ==? True
+prop_isColorableTestableGraph :: TestableGraph -> Bool
+prop_isColorableTestableGraph (TestableGraph g) = isColorable g
 
 -- | Check that our generated graphs are colorable
-prop_isColorableTestableClique :: TestableClique -> Property
-prop_isColorableTestableClique (TestableClique g) = isColorable g ==? True
+prop_isColorableTestableClique :: TestableClique -> Bool
+prop_isColorableTestableClique (TestableClique g) = isColorable g
 
 -- | Check that the given algorithm colors a clique with the same number of
 -- colors as the vertices number.