summaryrefslogtreecommitdiff
path: root/testsuite/tests/cabal/pkg02
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/cabal/pkg02')
-rw-r--r--testsuite/tests/cabal/pkg02/A.hs5
-rw-r--r--testsuite/tests/cabal/pkg02/Foreign.hs2
-rw-r--r--testsuite/tests/cabal/pkg02/Makefile4
-rw-r--r--testsuite/tests/cabal/pkg02/all.T10
-rw-r--r--testsuite/tests/cabal/pkg02/pkg02.stderr0
5 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/cabal/pkg02/A.hs b/testsuite/tests/cabal/pkg02/A.hs
new file mode 100644
index 0000000000..fa288c35e6
--- /dev/null
+++ b/testsuite/tests/cabal/pkg02/A.hs
@@ -0,0 +1,5 @@
+module A where
+import Foreign -- a local module
+import Foreign.C -- a package module
+
+y = Foreign.x
diff --git a/testsuite/tests/cabal/pkg02/Foreign.hs b/testsuite/tests/cabal/pkg02/Foreign.hs
new file mode 100644
index 0000000000..3970ce1896
--- /dev/null
+++ b/testsuite/tests/cabal/pkg02/Foreign.hs
@@ -0,0 +1,2 @@
+module Foreign (x) where
+x = "test"
diff --git a/testsuite/tests/cabal/pkg02/Makefile b/testsuite/tests/cabal/pkg02/Makefile
new file mode 100644
index 0000000000..4a268530f1
--- /dev/null
+++ b/testsuite/tests/cabal/pkg02/Makefile
@@ -0,0 +1,4 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
diff --git a/testsuite/tests/cabal/pkg02/all.T b/testsuite/tests/cabal/pkg02/all.T
new file mode 100644
index 0000000000..b3dfecc0b5
--- /dev/null
+++ b/testsuite/tests/cabal/pkg02/all.T
@@ -0,0 +1,10 @@
+# This used to be a test for conflicting module names, but the error
+# case that it was testing for went away (conflicting module names in
+# separate packages are allowed). Now it is a straightforward test
+# for shadowing: the local Foreign module shadows the base package
+# one.
+test('pkg02',
+ [extra_clean(['A.o', 'A.hi', 'Foreign.o', 'Foreign.hi'])],
+ multimod_compile,
+ ['A','-v0'])
+
diff --git a/testsuite/tests/cabal/pkg02/pkg02.stderr b/testsuite/tests/cabal/pkg02/pkg02.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/tests/cabal/pkg02/pkg02.stderr