summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAditya Gupta <adityagupta1089@gmail.com>2020-08-23 17:53:37 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-27 14:19:26 -0400
commit01ff8c89727a91cbc1571ae54f73f5919d6aaa71 (patch)
tree383ea51e53a93a8ca3a18fcaa213a84810576bc8 /testsuite
parent770100e0266750a313b34a52a60968410fcf0769 (diff)
downloadhaskell-01ff8c89727a91cbc1571ae54f73f5919d6aaa71.tar.gz
Consolidate imports in getMinimalImports (#18264)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/rename/should_compile/Makefile5
-rw-r--r--testsuite/tests/rename/should_compile/T18264.hs20
-rw-r--r--testsuite/tests/rename/should_compile/T18264.stdout6
-rw-r--r--testsuite/tests/rename/should_compile/all.T1
4 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/Makefile b/testsuite/tests/rename/should_compile/Makefile
index 495efed5cc..5744d60667 100644
--- a/testsuite/tests/rename/should_compile/Makefile
+++ b/testsuite/tests/rename/should_compile/Makefile
@@ -60,3 +60,8 @@ T7969:
T18497:
'$(TEST_HC)' $(TEST_HC_OPTS) -fno-code T18497_Foo.hs T18497_Bar.hs -ddump-minimal-imports
cat T18497_Bar.imports-boot
+
+T18264:
+ $(RM) T18264.hi T18264.o T18264.imports
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ddump-minimal-imports -c T18264.hs
+ cat T18264.imports
diff --git a/testsuite/tests/rename/should_compile/T18264.hs b/testsuite/tests/rename/should_compile/T18264.hs
new file mode 100644
index 0000000000..487f0c9a00
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T18264.hs
@@ -0,0 +1,20 @@
+module T18264 where
+
+import Data.Char (isDigit)
+import Data.Maybe (isJust)
+import Data.Char (isPrint)
+import Data.List (sortOn)
+import Data.Char (isLetter)
+import Data.Maybe hiding (isNothing)
+
+import qualified Data.List as S (sort)
+import qualified Data.Char as C --only isDigit & isLetter used later
+import qualified Data.List as T (nub)
+
+test1 x = isDigit x || isLetter x
+test2a = isJust
+test2b = fromJust
+test3 x = C.isDigit x || C.isLetter x
+test4 xs = S.sort xs
+test5 xs = T.nub xs
+test6 f xs = sortOn f xs
diff --git a/testsuite/tests/rename/should_compile/T18264.stdout b/testsuite/tests/rename/should_compile/T18264.stdout
new file mode 100644
index 0000000000..49fbed571e
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T18264.stdout
@@ -0,0 +1,6 @@
+import Data.Char ( isDigit, isLetter )
+import Data.List ( sortOn )
+import Data.Maybe ( fromJust, isJust )
+import qualified Data.Char as C ( isLetter, isDigit )
+import qualified Data.List as S ( sort )
+import qualified Data.List as T ( nub )
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index 9a519483d5..ae82bd30c6 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -175,3 +175,4 @@ test('T17244C', normal, compile, [''])
test('T17832', [], multimod_compile, ['T17832M1', 'T17832M2'])
test('T17837', normal, compile, [''])
test('T18497', [], makefile_test, ['T18497'])
+test('T18264', [], makefile_test, ['T18264'])