From 79f7d262ed0246ea6556478c611c0db59bb47191 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Grave Date: Mon, 25 Feb 2019 16:27:35 +0000 Subject: Reformat using brittany --- test/Property.hs | 17 +++++++++++------ test/Unit.hs | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'test') 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" -- cgit