Safe Haskell | None |
---|
Unittests for Ganeti.Htools.Graph
Synopsis
- data TestableGraph = TestableGraph Graph
- data TestableClique = TestableClique Graph
- undirEdges :: Gen (Bounds, [Edge])
- cliqueEdges :: Gen (Bounds, [Edge])
- case_emptyVertColorMapNull :: Assertion
- case_emptyVertColorMapEmpty :: Assertion
- anyTwo :: (a -> a -> Bool) -> [a] -> Bool
- prop_verticesByDegreeAscAsc :: TestableGraph -> Bool
- prop_verticesByDegreeDescDesc :: TestableGraph -> Bool
- prop_isColorableTestableGraph :: TestableGraph -> Bool
- prop_isColorableTestableClique :: TestableClique -> Bool
- prop_colorClique :: (Graph -> VertColorMap) -> TestableClique -> Property
- prop_colorLFClique :: TestableClique -> Property
- prop_colorDsaturClique :: TestableClique -> Property
- prop_colorDcolorClique :: TestableClique -> Property
- prop_colorAllNodes :: (Graph -> VertColorMap) -> TestableGraph -> Property
- prop_colorLFAllNodes :: TestableGraph -> Property
- prop_colorDsaturAllNodes :: TestableGraph -> Property
- prop_colorDcolorAllNodes :: TestableGraph -> Property
- prop_colorProper :: (Graph -> VertColorMap) -> TestableGraph -> Bool
- prop_colorLFProper :: TestableGraph -> Bool
- prop_colorDsaturProper :: TestableGraph -> Bool
- prop_colorDcolorProper :: TestableGraph -> Bool
- testHTools_Graph :: Test
Documentation
data TestableGraph Source #
TestableGraph Graph |
data TestableClique Source #
TestableClique Graph |
undirEdges :: Gen (Bounds, [Edge]) Source #
Generate node bounds and edges for an undirected graph. A graph is undirected if for every (a, b) edge there is a corresponding (b, a) one.
cliqueEdges :: Gen (Bounds, [Edge]) Source #
Generate node bounds and edges for a clique. In a clique all nodes are directly connected to each other.
case_emptyVertColorMapNull :: Assertion Source #
Check that the empty vertex color map is empty.
case_emptyVertColorMapEmpty :: Assertion Source #
Check that the empty vertex color map is zero in size.
anyTwo :: (a -> a -> Bool) -> [a] -> Bool Source #
Check if each two consecutive elements on a list respect a given condition.
prop_verticesByDegreeAscAsc :: TestableGraph -> Bool Source #
Check order of vertices returned by verticesByDegreeAsc.
prop_verticesByDegreeDescDesc :: TestableGraph -> Bool Source #
Check order of vertices returned by verticesByDegreeDesc.
prop_isColorableTestableGraph :: TestableGraph -> Bool Source #
Check that our generated graphs are colorable
prop_isColorableTestableClique :: TestableClique -> Bool Source #
Check that our generated graphs are colorable
prop_colorClique :: (Graph -> VertColorMap) -> TestableClique -> Property Source #
Check that the given algorithm colors a clique with the same number of colors as the vertices number.
prop_colorLFClique :: TestableClique -> Property Source #
Specific check for the LF algorithm.
prop_colorDsaturClique :: TestableClique -> Property Source #
Specific check for the Dsatur algorithm.
prop_colorDcolorClique :: TestableClique -> Property Source #
Specific check for the Dcolor algorithm.
prop_colorAllNodes :: (Graph -> VertColorMap) -> TestableGraph -> Property Source #
prop_colorLFAllNodes :: TestableGraph -> Property Source #
Specific check for the LF algorithm.
prop_colorDsaturAllNodes :: TestableGraph -> Property Source #
Specific check for the Dsatur algorithm.
prop_colorDcolorAllNodes :: TestableGraph -> Property Source #
Specific check for the Dcolor algorithm.
prop_colorProper :: (Graph -> VertColorMap) -> TestableGraph -> Bool Source #
Check that no two vertices sharing the same edge have the same color.
prop_colorLFProper :: TestableGraph -> Bool Source #
Specific check for the LF algorithm.
prop_colorDsaturProper :: TestableGraph -> Bool Source #
Specific check for the Dsatur algorithm.
prop_colorDcolorProper :: TestableGraph -> Bool Source #
Specific check for the Dcolor algorithm.
testHTools_Graph :: Test Source #
List of tests for the Graph module.