aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-03-31 22:17:54 +0100
committerYann Herklotz <git@ymhg.org>2019-03-31 22:17:54 +0100
commitd077ab33940f23873eb34254cc8b168bef4a82c9 (patch)
tree3fd2301755808e240430365db6325114351e6066
parent1930e7686025601e22de49aa4d4dbeed8311caa0 (diff)
downloadverismith-d077ab33940f23873eb34254cc8b168bef4a82c9.tar.gz
verismith-d077ab33940f23873eb34254cc8b168bef4a82c9.zip
Fix some of the tests
-rw-r--r--src/VeriFuzz/Parser/Parser.hs3
-rw-r--r--test/Property.hs5
-rw-r--r--verifuzz.cabal1
3 files changed, 6 insertions, 3 deletions
diff --git a/src/VeriFuzz/Parser/Parser.hs b/src/VeriFuzz/Parser/Parser.hs
index 5a1d163..4ba36e2 100644
--- a/src/VeriFuzz/Parser/Parser.hs
+++ b/src/VeriFuzz/Parser/Parser.hs
@@ -125,7 +125,8 @@ systemFunc s = satisfy' matchId
parseFunction :: Parser Function
parseFunction =
- systemFunc "unsigned" $> UnSignedFunc <|> systemFunc "signed" $> SignedFunc
+ systemFunc "$unsigned" $> UnSignedFunc
+ <|> systemFunc "$signed" $> SignedFunc
parseFun :: Parser Expr
parseFun = do
diff --git a/test/Property.hs b/test/Property.hs
index 2b523dd..e44e59b 100644
--- a/test/Property.hs
+++ b/test/Property.hs
@@ -11,6 +11,7 @@ import Test.Tasty.QuickCheck ((===))
import qualified Test.Tasty.QuickCheck as QC
import Text.Parsec
import VeriFuzz
+import VeriFuzz.Parser.Lex
import qualified VeriFuzz.RandomAlt as V
newtype TestGraph = TestGraph { getGraph :: Gr Gate () }
@@ -44,7 +45,7 @@ simpleAltGraph = QC.testProperty "simple alternative graph generation check"
where simp = G.isSimple . getAltGraph
parserInput' :: ModDeclSub -> Bool
-parserInput' (ModDeclSub v) = isRight $ parse parseModDecl "input_test.v" str
+parserInput' (ModDeclSub v) = isRight $ parse parseModDecl "input_test.v" (alexScanTokens str)
where str = show . GenVerilog $ v
parserIdempotent' :: ModDeclSub -> QC.Property
@@ -54,7 +55,7 @@ parserIdempotent' (ModDeclSub v) = p sv === (p . p) sv
sv = vshow v
p = vshow . fromRight (error "Failed idempotent test") . parse
parseModDecl
- "idempotent_test.v"
+ "idempotent_test.v" . alexScanTokens
parserInput :: TestTree
parserInput = QC.testProperty "parser input" $ parserInput'
diff --git a/verifuzz.cabal b/verifuzz.cabal
index 267dffe..f67d1e8 100644
--- a/verifuzz.cabal
+++ b/verifuzz.cabal
@@ -113,6 +113,7 @@ test-suite verifuzz-doctest
hs-source-dirs: test
main-is: Doctest.hs
ghc-options: -Wall -Werror
+ build-tools: alex >=3 && <4
build-depends: base >=4.7 && <5
, verifuzz >=0.1 && <0.2
, doctest >=0.16 && <0.17