Skip to content

Commit 981a404

Browse files
committed
Fix bench
1 parent 9a77111 commit 981a404

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/Hie/Cabal/Parser.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ parseComponent :: Indent -> Parser Component
5656
parseComponent i =
5757
parseExe i
5858
<|> parseLib i
59+
<|> parseBench i
5960
<|> parseTestSuite i
6061

6162
parseLib :: Indent -> Parser Component

test/Spec.hs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ spec = do
2828
`shouldParse` Comp Lib "" "src"
2929
describe "Should Succeed"
3030
$ it "successfully parses bench section"
31-
$ benchSection ~> parseBench 0
32-
`shouldParse` Comp Bench "folds" "benchmarks/folds.hs"
31+
$ do
32+
bs <- T.readFile "test/benchSection"
33+
bs ~> parseBench 0
34+
`shouldParse` Comp Bench "folds" "benchmarks/folds.hs"
3335
describe "Should Succeed"
3436
$ it "successfully parses package"
3537
$ fullFile ~> parsePackage
@@ -106,15 +108,6 @@ libSection =
106108
\ default-language: Haskell2010\n\
107109
\"
108110

109-
benchSection :: Text
110-
benchSection =
111-
"benchmark folds\n\
112-
\ default-language: Haskell2010\n\
113-
\ hs-source-dirs: benchmarks\n\
114-
\ ghc-options: -Wall -threaded\n\
115-
\ type: exitcode-stdio-1.0\n\
116-
\ main-is: folds.hs\n"
117-
118111
stackHie :: String
119112
stackHie =
120113
"cradle:\n\

0 commit comments

Comments
 (0)