Skip to content

Commit

Permalink
Add failing test case for #2781
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Oct 22, 2017
1 parent c8c7465 commit 5a9d51d
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/integration/tests/2781-shadow-bug/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import StackTest
import System.Directory

main :: IO ()
main = do
createDirectoryIfMissing True "foo/src"
readFile "foo/v1/Foo.hs" >>= writeFile "foo/src/Foo.hs"
stack ["bench"]
readFile "foo/v2/Foo.hs" >>= writeFile "foo/src/Foo.hs"
stack ["bench"]
18 changes: 18 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/bar/bar.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: bar
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.10

library
hs-source-dirs: src
exposed-modules: Bar
build-depends: base, foo
default-language: Haskell2010

benchmark bench
type: exitcode-stdio-1.0
hs-source-dirs: bench
main-is: bench.hs
build-depends: base
, bar
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main :: IO ()
main = return ()
8 changes: 8 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/bar/src/Bar.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Bar
( bar
) where

import Foo

bar :: IO ()
bar = foo
10 changes: 10 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/foo/foo.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: foo
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.10

library
hs-source-dirs: src
exposed-modules: Foo
build-depends: base
default-language: Haskell2010
6 changes: 6 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/foo/v1/Foo.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Foo
( foo
) where

foo :: IO ()
foo = putStrLn "foo1"
6 changes: 6 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/foo/v2/Foo.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Foo
( foo
) where

foo :: IO ()
foo = putStrLn "foo2"
4 changes: 4 additions & 0 deletions test/integration/tests/2781-shadow-bug/files/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resolver: ghc-8.2.1
packages:
- foo
- bar

0 comments on commit 5a9d51d

Please sign in to comment.