@@ -17,7 +17,9 @@ spec = do
17
17
describe " Should Succeed"
18
18
$ it " successfully parses executable section"
19
19
$ exeSection ~> parseExe 0
20
- `shouldParse` [Comp Exe " implicit-hie-exe" " app/Main.hs" ]
20
+ `shouldParse` [ Comp Exe " implicit-hie-exe" " app/Main.hs" ,
21
+ Comp Exe " implicit-hie-exe" " app/Paths_implicit_hie.hs"
22
+ ]
21
23
describe " Should Succeed"
22
24
$ it " successfully parses test section"
23
25
$ testSection ~> parseTestSuite 0
@@ -42,13 +44,16 @@ spec = do
42
44
`shouldParse` [Comp Bench " folds" " benchmarks/folds.hs" ]
43
45
describe " Should Succeed"
44
46
$ it " successfully parses package"
45
- $ fullFile ~> parsePackage
46
- `shouldParse` Package
47
- " implicit-hie"
48
- [ Comp Lib " " " src" ,
49
- Comp Exe " implicit-hie-exe" " app/Main.hs" ,
50
- Comp Test " implicit-hie-test" " test"
51
- ]
47
+ $ do
48
+ cf <- T. readFile " implicit-hie.cabal"
49
+ cf ~> parsePackage
50
+ `shouldParse` Package
51
+ " implicit-hie"
52
+ [ Comp Lib " " " src" ,
53
+ Comp Exe " implicit-hie-exe" " app/Main.hs" ,
54
+ Comp Exe " implicit-hie-exe" " app/Paths_implicit_hie.hs" ,
55
+ Comp Test " implicit-hie-test" " test"
56
+ ]
52
57
describe " Should Succeed"
53
58
$ it
54
59
" skips to end of block section"
@@ -57,10 +62,13 @@ spec = do
57
62
`leavesUnconsumed` r
58
63
describe " Should Succeed"
59
64
$ it " successfully generates stack hie.yaml"
60
- $ (hieYaml " stack" . fmtPkgs " stack" . (: [] ) <$> parseOnly parsePackage fullFile)
61
- `shouldBe` Right stackHie
65
+ $ do
66
+ sf <- readFile " test/stackHie.yaml"
67
+ cf <- T. readFile " implicit-hie.cabal"
68
+ (hieYaml " stack" . fmtPkgs " stack" . (: [] ) <$> parseOnly parsePackage cf)
69
+ `shouldBe` Right sf
62
70
describe " Should Succeed"
63
- $ it " successfully generates stack hie.yaml"
71
+ $ it " successfully generates cabal hie.yaml for haskell-language-server "
64
72
$ do
65
73
f <- T. readFile " test/haskell-language-server-cabal"
66
74
o <- readFile " test/hie.yaml.cbl"
@@ -82,9 +90,6 @@ spec = do
82
90
$ (" \" one\"\n two\n three3" :: Text ) ~> parseList 1
83
91
`shouldParse` [" one" , " two" , " three3" ]
84
92
85
- fullFile :: Text
86
- fullFile = " name: implicit-hie\n " <> libSection <> exeSection <> testSection
87
-
88
93
exeSection :: Text
89
94
exeSection =
90
95
" executable implicit-hie-exe\n \
@@ -167,17 +172,3 @@ libSection3 =
167
172
\ , text\n \
168
173
\ default-language: Haskell2010\n \
169
174
\"
170
-
171
- stackHie :: String
172
- stackHie =
173
- " cradle:\n \
174
- \ stack:\n \
175
- \ - path: \" src\"\n \
176
- \ component: \" implicit-hie:lib\"\n \
177
- \\n \
178
- \ - path: \" app/Main.hs\"\n \
179
- \ component: \" implicit-hie:exe:implicit-hie-exe\"\n \
180
- \\n \
181
- \ - path: \" test\"\n \
182
- \ component: \" implicit-hie:test:implicit-hie-test\"\n \
183
- \"
0 commit comments