Make sure preprocessed module are on the module path
This commit is contained in:
parent
bb22b643e9
commit
c4d534ba1c
@ -78,6 +78,9 @@ Extra-Source-Files: ChangeLog
|
||||
test/data/custom-cradle/package-db-a/.gitkeep
|
||||
test/data/custom-cradle/package-db-b/.gitkeep
|
||||
test/data/custom-cradle/package-db-c/.gitkeep
|
||||
test/data/cabal-preprocessors/*.cabal
|
||||
test/data/cabal-preprocessors/*.hs
|
||||
test/data/cabal-preprocessors/*.hsc
|
||||
|
||||
Library
|
||||
Default-Language: Haskell2010
|
||||
|
@ -57,3 +57,10 @@ spec = do
|
||||
withDirectory_ "test/data/check-missing-warnings" $ do
|
||||
res <- runD $ checkSyntax ["DesugarWarnings.hs"]
|
||||
res `shouldBe` "DesugarWarnings.hs:4:9:Warning: Pattern match(es) are non-exhaustive\NULIn a case alternative: Patterns not matched: _ : _\n"
|
||||
|
||||
it "works with cabal builtin preprocessors" $ do
|
||||
withDirectory_ "test/data/cabal-preprocessors" $ do
|
||||
_ <- system "cabal clean"
|
||||
_ <- system "cabal build"
|
||||
res <- runD $ checkSyntax ["Main.hs"]
|
||||
res `shouldBe` "Preprocessed.hsc:3:1:Warning: Top-level binding with no type signature: warning :: ()\n"
|
||||
|
4
test/data/cabal-preprocessors/Main.hs
Normal file
4
test/data/cabal-preprocessors/Main.hs
Normal file
@ -0,0 +1,4 @@
|
||||
import Preprocessed
|
||||
|
||||
main :: IO ()
|
||||
main = return warning
|
3
test/data/cabal-preprocessors/Preprocessed.hsc
Normal file
3
test/data/cabal-preprocessors/Preprocessed.hsc
Normal file
@ -0,0 +1,3 @@
|
||||
module Preprocessed where
|
||||
|
||||
warning = ()
|
14
test/data/cabal-preprocessors/cabal-preprocessors.cabal
Normal file
14
test/data/cabal-preprocessors/cabal-preprocessors.cabal
Normal file
@ -0,0 +1,14 @@
|
||||
name: cabal-preprocessors
|
||||
version: 0.1.0.0
|
||||
license-file: LICENSE
|
||||
author: asd
|
||||
maintainer: asd
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
|
||||
executable cabal-preprocessors
|
||||
main-is: Main.hs
|
||||
build-depends: base
|
||||
default-language: Haskell2010
|
||||
other-modules: Preprocessed
|
||||
ghc-options: -Wall
|
Loading…
Reference in New Issue
Block a user