diff options
author | Yann Herklotz Grave <git@yannherklotzgrave.com> | 2019-02-25 16:27:35 +0000 |
---|---|---|
committer | Yann Herklotz Grave <git@yannherklotzgrave.com> | 2019-02-25 16:27:35 +0000 |
commit | 79f7d262ed0246ea6556478c611c0db59bb47191 (patch) | |
tree | 0ba641865d69e02345283553d0f636544ddea719 /test | |
parent | d4b2664d8ecddbfa0e0aae42d32f39edae2f930b (diff) | |
download | verismith-79f7d262ed0246ea6556478c611c0db59bb47191.tar.gz verismith-79f7d262ed0246ea6556478c611c0db59bb47191.zip |
Reformat using brittany
Diffstat (limited to 'test')
-rw-r--r-- | test/Property.hs | 17 | ||||
-rw-r--r-- | test/Unit.hs | 18 |
2 files changed, 24 insertions, 11 deletions
diff --git a/test/Property.hs b/test/Property.hs index 8a32751..2b523dd 100644 --- a/test/Property.hs +++ b/test/Property.hs @@ -34,11 +34,13 @@ instance QC.Arbitrary AltTestGraph where arbitrary = AltTestGraph <$> QC.resize 100 V.randomDAG simpleGraph :: TestTree -simpleGraph = QC.testProperty "simple graph generation check" $ \graph -> simp graph +simpleGraph = QC.testProperty "simple graph generation check" + $ \graph -> simp graph where simp = G.isSimple . getGraph simpleAltGraph :: TestTree -simpleAltGraph = QC.testProperty "simple alternative graph generation check" $ \graph -> simp graph +simpleAltGraph = QC.testProperty "simple alternative graph generation check" + $ \graph -> simp graph where simp = G.isSimple . getAltGraph parserInput' :: ModDeclSub -> Bool @@ -49,8 +51,10 @@ parserIdempotent' :: ModDeclSub -> QC.Property parserIdempotent' (ModDeclSub v) = p sv === (p . p) sv where vshow = show . GenVerilog - sv = vshow v - p = vshow . fromRight (error "Failed idempotent test") . parse parseModDecl "idempotent_test.v" + sv = vshow v + p = vshow . fromRight (error "Failed idempotent test") . parse + parseModDecl + "idempotent_test.v" parserInput :: TestTree parserInput = QC.testProperty "parser input" $ parserInput' @@ -59,5 +63,6 @@ parserIdempotent :: TestTree parserIdempotent = QC.testProperty "parser idempotence" $ parserIdempotent' propertyTests :: TestTree -propertyTests = - testGroup "Property Tests" [simpleGraph, simpleAltGraph, parserInput, parserIdempotent] +propertyTests = testGroup + "Property Tests" + [simpleGraph, simpleAltGraph, parserInput, parserIdempotent] diff --git a/test/Unit.hs b/test/Unit.hs index d911d2f..7878eaa 100644 --- a/test/Unit.hs +++ b/test/Unit.hs @@ -11,14 +11,18 @@ import VeriFuzz unitTests :: TestTree unitTests = testGroup "Unit tests" - [ testCase "Transformation of AST" $ assertEqual "Successful transformation" - transformExpectedResult - (transform trans transformTestData) + [ testCase "Transformation of AST" $ assertEqual + "Successful transformation" + transformExpectedResult + (transform trans transformTestData) ] transformTestData :: Expr transformTestData = BinOp - (BinOp (BinOp (Id "id1") BinAnd (Id "id2")) BinAnd (BinOp (Id "id1") BinAnd (Id "id2"))) + (BinOp (BinOp (Id "id1") BinAnd (Id "id2")) + BinAnd + (BinOp (Id "id1") BinAnd (Id "id2")) + ) BinAnd (BinOp (BinOp @@ -74,7 +78,11 @@ transformExpectedResult = BinOp [ Concat [Id "id1", Id "Replaced", Id "Replaced"] , Id "Replaced" , Id "Replaced" - , Concat [Id "Replaced", Id "Replaced", Concat [Id "id1", Id "Replaced"]] + , Concat + [ Id "Replaced" + , Id "Replaced" + , Concat [Id "id1", Id "Replaced"] + ] , Id "Replaced" ] , Id "id1" |