-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bee8624
commit 5e6635f
Showing
6 changed files
with
52 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,19 @@ | ||
import Algebra.Graph.Test.Acyclic.AdjacencyMap | ||
import Algebra.Graph.Test.AdjacencyIntMap | ||
import Algebra.Graph.Test.AdjacencyMap | ||
import Algebra.Graph.Test.NonEmpty.AdjacencyMap | ||
import Algebra.Graph.Test.Export | ||
import Algebra.Graph.Test.Graph | ||
import Algebra.Graph.Test.NonEmpty.Graph | ||
import Algebra.Graph.Test.Internal | ||
import Algebra.Graph.Test.Labelled.AdjacencyMap | ||
import Algebra.Graph.Test.Labelled.Graph | ||
import Algebra.Graph.Test.Relation | ||
import Algebra.Graph.Test.Relation.SymmetricRelation | ||
import Data.Graph.Test.Typed | ||
import Algebra.Graph (Graph) | ||
import Algebra.Graph.NonEmpty (components, vertexCount) | ||
import Algebra.Graph.Test.Arbitrary | ||
import Data.Foldable | ||
import qualified Data.Set as S | ||
import Test.QuickCheck | ||
import Test.QuickCheck.Gen | ||
import Test.QuickCheck.Random | ||
|
||
import Control.Monad | ||
import System.Environment | ||
genSeed seed (MkGen g) = | ||
do let r = mkQCGen seed | ||
return (g r 30) | ||
|
||
-- | By default, all testsuites will be executed, which takes a few minutes. If | ||
-- you would like to execute only some specific testsuites, you can specify | ||
-- their names in the command line. For example: | ||
-- | ||
-- stack test --test-arguments "Graph SymmetricRelation" | ||
-- | ||
-- will test the modules "Algebra.Graph" and "Algebra.Graph.Symmetric.Relation". | ||
main :: IO () | ||
main = do | ||
selected <- getArgs | ||
let go current = when (null selected || current `elem` selected) | ||
go "AcyclicAdjacencyMap" testAcyclicAdjacencyMap | ||
go "AdjacencyIntMap" testAdjacencyIntMap | ||
go "AdjacencyMap" testAdjacencyMap | ||
go "Export" testExport | ||
go "Graph" testGraph | ||
go "Internal" testInternal | ||
go "LabelledAdjacencyMap" testLabelledAdjacencyMap | ||
go "LabelledGraph" testLabelledGraph | ||
go "NonEmptyAdjacencyMap" testNonEmptyAdjacencyMap | ||
go "NonEmptyGraph" testNonEmptyGraph | ||
go "Relation" testRelation | ||
go "SymmetricRelation" testSymmetricRelation | ||
go "Typed" testTyped | ||
let gen = (resize 100 $ arbitrary) :: Gen (Graph Int) | ||
for_ [1..1000] $ \seed -> do | ||
g <- genSeed seed gen | ||
print (vertexCount <$> (S.toList $ components g)) |