mirror of
https://github.com/Avi-D-coder/implicit-hie.git
synced 2024-11-26 00:04:23 +03:00
Merge pull request #22 from jneira/exe-other-mods
Fix exe other-modules containing dots
This commit is contained in:
commit
f971186c87
@ -121,9 +121,10 @@ pathMain i p m o a =
|
||||
<|> (skipBlockLine i >> pathMain i p m o a)
|
||||
<|> pure
|
||||
( map (<//> m) p
|
||||
<> [ p' <//> (o' <> ".hs")
|
||||
<> [ p' <//> (o'' <> ".hs")
|
||||
| p' <- p,
|
||||
o' <- filter (`notElem` a) o
|
||||
o' <- filter (`notElem` a) o,
|
||||
let o'' = T.replace "." "/" o'
|
||||
]
|
||||
)
|
||||
|
||||
|
17
test/Spec.hs
17
test/Spec.hs
@ -90,6 +90,13 @@ spec = do
|
||||
$ it "list with leading commas"
|
||||
$ ("one\n , two\n , three3" :: Text) ~> parseList 1
|
||||
`shouldParse` ["one", "two", "three3"]
|
||||
describe "Should Succeed"
|
||||
$ it "succesfully parses exe component with other-modules containing dots"
|
||||
$ exeSection2 ~> parseExe 0
|
||||
`shouldParse` [ Comp Exe "gen-hie" "app/Main.hs"
|
||||
, Comp Exe "gen-hie" "app/Hie/Executable/Helper.hs"
|
||||
, Comp Exe "gen-hie" "app/Hie/Executable/Utils.hs"
|
||||
]
|
||||
|
||||
exeSection :: Text
|
||||
exeSection =
|
||||
@ -175,3 +182,13 @@ libSection3 =
|
||||
\ , text\n\
|
||||
\ default-language: Haskell2010\n\
|
||||
\"
|
||||
|
||||
exeSection2 :: Text
|
||||
exeSection2 =
|
||||
"executable gen-hie\n\
|
||||
\ other-modules:\n\
|
||||
\ Hie.Executable.Helper\n\
|
||||
\ Hie.Executable.Utils\n\
|
||||
\ hs-source-dirs:\n\
|
||||
\ app\n\
|
||||
\ main-is: Main.hs \n"
|
Loading…
Reference in New Issue
Block a user