aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Property.hs
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-11-30 23:00:52 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-11-30 23:00:52 +0000
commitc4c80116eca7d498176b3f6fb8278f5bf8a17ea3 (patch)
tree33c5aa9180bee08c1edb6df0ea8a182673f2f6ea /tests/Property.hs
parent1f6343a964216ac67255df1c00412c672cda0784 (diff)
downloadverismith-c4c80116eca7d498176b3f6fb8278f5bf8a17ea3.tar.gz
verismith-c4c80116eca7d498176b3f6fb8278f5bf8a17ea3.zip
Add first property test
Diffstat (limited to 'tests/Property.hs')
-rw-r--r--tests/Property.hs20
1 files changed, 20 insertions, 0 deletions
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
+ ]