From c4c80116eca7d498176b3f6fb8278f5bf8a17ea3 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 30 Nov 2018 23:00:52 +0000 Subject: Add first property test --- tests/Property.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/Property.hs (limited to 'tests/Property.hs') diff --git a/tests/Property.hs b/tests/Property.hs new file mode 100644 index 0000000..ba9152e --- /dev/null +++ b/tests/Property.hs @@ -0,0 +1,20 @@ +module Property (propertyTests) where + +import Data.Graph.Inductive +import Test.Tasty +import Test.Tasty.QuickCheck as QC +import Test.VeriFuzz + +newtype TestGraph = TestGraph { getGraph :: Gr Gate ()} + deriving (Show) + +instance QC.Arbitrary TestGraph where + arbitrary = TestGraph <$> randomDAG 100 + +simpleGraph = QC.testProperty "simple graph generation" $ + \graph -> isSimple (getGraph (graph :: TestGraph)) == True + +propertyTests :: TestTree +propertyTests = testGroup "Property" + [ simpleGraph + ] -- cgit