From 4671b8bc31b75717329186f50159e2e9cbbf3719 Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 16 Sep 1999 17:38:12 +0000 Subject: [PATCH] [project @ 1999-09-16 17:38:12 by sof] Bunch of H98 tests I had lying about --- ghc/tests/rename/should_compile/Makefile | 1 + ghc/tests/rename/should_compile/rn025.hs | 5 +++++ ghc/tests/rename/should_compile/rn025.stderr | 6 ++++++ ghc/tests/rename/should_compile/rn026.hs | 12 ++++++++++++ ghc/tests/rename/should_compile/rn027.hs | 12 ++++++++++++ ghc/tests/rename/should_compile/rn028.hs | 18 ++++++++++++++++++ ghc/tests/rename/should_compile/rn029.hs | 8 ++++++++ ghc/tests/rename/should_compile/rn030.hs | 12 ++++++++++++ ghc/tests/rename/should_compile/rn031.hs | 12 ++++++++++++ ghc/tests/rename/should_compile/rn032.hs | 18 ++++++++++++++++++ ghc/tests/rename/should_compile/rn033.hs | 8 ++++++++ ghc/tests/rename/should_compile/rn034.hs | 12 ++++++++++++ ghc/tests/rename/should_compile/rn035.hs | 10 ++++++++++ ghc/tests/rename/should_compile/rn036.hs | 13 +++++++++++++ 14 files changed, 147 insertions(+) create mode 100644 ghc/tests/rename/should_compile/rn025.hs create mode 100644 ghc/tests/rename/should_compile/rn025.stderr create mode 100644 ghc/tests/rename/should_compile/rn026.hs create mode 100644 ghc/tests/rename/should_compile/rn027.hs create mode 100644 ghc/tests/rename/should_compile/rn028.hs create mode 100644 ghc/tests/rename/should_compile/rn029.hs create mode 100644 ghc/tests/rename/should_compile/rn030.hs create mode 100644 ghc/tests/rename/should_compile/rn031.hs create mode 100644 ghc/tests/rename/should_compile/rn032.hs create mode 100644 ghc/tests/rename/should_compile/rn033.hs create mode 100644 ghc/tests/rename/should_compile/rn034.hs create mode 100644 ghc/tests/rename/should_compile/rn035.hs create mode 100644 ghc/tests/rename/should_compile/rn036.hs diff --git a/ghc/tests/rename/should_compile/Makefile b/ghc/tests/rename/should_compile/Makefile index fd954bb..ed85077 100644 --- a/ghc/tests/rename/should_compile/Makefile +++ b/ghc/tests/rename/should_compile/Makefile @@ -5,6 +5,7 @@ include $(TOP)/mk/should_compile.mk SRC_HC_OPTS += -noC -dcore-lint rn017_HC_OPTS = -hi -hi-with-exports +rn025_HC_OPTS = -hi -hi-with-exports include $(TOP)/mk/target.mk diff --git a/ghc/tests/rename/should_compile/rn025.hs b/ghc/tests/rename/should_compile/rn025.hs new file mode 100644 index 0000000..2d4838c --- /dev/null +++ b/ghc/tests/rename/should_compile/rn025.hs @@ -0,0 +1,5 @@ +-- !!! Re-exporting a module whose contents is partially hidden. +module ShouldSucceed ( module List ) where + +import List hiding ( sort ) + diff --git a/ghc/tests/rename/should_compile/rn025.stderr b/ghc/tests/rename/should_compile/rn025.stderr new file mode 100644 index 0000000..db86800 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn025.stderr @@ -0,0 +1,6 @@ +ghc: module version changed to 1; reason: no old .hi file +__export List delete deleteBy deleteFirstsBy elemIndex elemIndices find findIndex findIndices genericDrop genericIndex genericLength genericReplicate genericSplitAt genericTake group groupBy inits insert insertBy intersect intersectBy intersperse isPrefixOf isSuffixOf mapAccumL mapAccumR maximumBy minimumBy nub nubBy partition sortBy tails transpose unfoldr union unionBy unzzip4 unzzip5 unzzip6 unzzip7 zrzr zzip4 zzip5 zzip6 zzip7 zzipWith4 zzipWith5 zzipWith6 zzipWith7; +__export PrelBase ZMZN{ZMZN ZC} foldr map zpzp; +__export PrelList all and any break concat concatMap cycle drop dropWhile elem filter foldl foldl1 foldr1 head init iterate last length lookup maximum minimum notElem null or repeat replicate reverse scanl scanl1 scanr scanr1 span splitAt tail take takeWhile unzzip unzzip3 znzn zzip zzip3 zzipWith zzipWith3; +__export PrelShow lines unlines unwords words; +__export Prelude product sum; diff --git a/ghc/tests/rename/should_compile/rn026.hs b/ghc/tests/rename/should_compile/rn026.hs new file mode 100644 index 0000000..ff705b6 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn026.hs @@ -0,0 +1,12 @@ +-- !!! Checking that more than imported module can share a local +-- !!! local alias. +module ShouldSucceed where + +import qualified List as X +import qualified Maybe as X + +x :: Ord a => [a] -> [a] +x = X.sort + +y :: Maybe a -> Bool +y = X.isJust diff --git a/ghc/tests/rename/should_compile/rn027.hs b/ghc/tests/rename/should_compile/rn027.hs new file mode 100644 index 0000000..c773f91 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn027.hs @@ -0,0 +1,12 @@ +-- !!! Checking that an imported module may still have +-- !!! a local alias without having used 'qualified'. +module ShouldSucceed where + +import List as X +import Maybe as X + +x :: Ord a => [a] -> [a] +x = X.sort + +y :: Maybe a -> Bool +y = X.isJust diff --git a/ghc/tests/rename/should_compile/rn028.hs b/ghc/tests/rename/should_compile/rn028.hs new file mode 100644 index 0000000..82438e8 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn028.hs @@ -0,0 +1,18 @@ +-- !!! Checking that a toplevel declaration 'f' in module M is accessible +-- !!! as both 'f' and 'M.f' within the scope of M. Similarly for imported +-- !!! entities. +module ShouldSucceed where + +import List ( sort ) + +x :: Int +x = 2 + +y :: Int +y = x + +z :: Int +z = ShouldSucceed.x + +sortOf :: Ord a=> [a] -> [a] +sortOf = List.sort diff --git a/ghc/tests/rename/should_compile/rn029.hs b/ghc/tests/rename/should_compile/rn029.hs new file mode 100644 index 0000000..c6cd70c --- /dev/null +++ b/ghc/tests/rename/should_compile/rn029.hs @@ -0,0 +1,8 @@ +-- !!! Checking that lazy name clashing work. +module ShouldSucceed where + +import List ( sort ) + +ShouldSucceed.sort :: Int +ShouldSucceed.sort = 3 + diff --git a/ghc/tests/rename/should_compile/rn030.hs b/ghc/tests/rename/should_compile/rn030.hs new file mode 100644 index 0000000..ff705b6 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn030.hs @@ -0,0 +1,12 @@ +-- !!! Checking that more than imported module can share a local +-- !!! local alias. +module ShouldSucceed where + +import qualified List as X +import qualified Maybe as X + +x :: Ord a => [a] -> [a] +x = X.sort + +y :: Maybe a -> Bool +y = X.isJust diff --git a/ghc/tests/rename/should_compile/rn031.hs b/ghc/tests/rename/should_compile/rn031.hs new file mode 100644 index 0000000..4ffeaca --- /dev/null +++ b/ghc/tests/rename/should_compile/rn031.hs @@ -0,0 +1,12 @@ +-- !!! Checking that an imported module may still have +-- !!! a local alias without having used 'qualified'. +module ShouldSucceed where + +import List as X +import Maybe as X + +x :: Ord a => [a] -> [a] +x = X.sort + +y :: Maybe a -> Bool +y = isJust diff --git a/ghc/tests/rename/should_compile/rn032.hs b/ghc/tests/rename/should_compile/rn032.hs new file mode 100644 index 0000000..82438e8 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn032.hs @@ -0,0 +1,18 @@ +-- !!! Checking that a toplevel declaration 'f' in module M is accessible +-- !!! as both 'f' and 'M.f' within the scope of M. Similarly for imported +-- !!! entities. +module ShouldSucceed where + +import List ( sort ) + +x :: Int +x = 2 + +y :: Int +y = x + +z :: Int +z = ShouldSucceed.x + +sortOf :: Ord a=> [a] -> [a] +sortOf = List.sort diff --git a/ghc/tests/rename/should_compile/rn033.hs b/ghc/tests/rename/should_compile/rn033.hs new file mode 100644 index 0000000..c6cd70c --- /dev/null +++ b/ghc/tests/rename/should_compile/rn033.hs @@ -0,0 +1,8 @@ +-- !!! Checking that lazy name clashing work. +module ShouldSucceed where + +import List ( sort ) + +ShouldSucceed.sort :: Int +ShouldSucceed.sort = 3 + diff --git a/ghc/tests/rename/should_compile/rn034.hs b/ghc/tests/rename/should_compile/rn034.hs new file mode 100644 index 0000000..3117391 --- /dev/null +++ b/ghc/tests/rename/should_compile/rn034.hs @@ -0,0 +1,12 @@ +-- !!! Checking that empty declarations are permitted. +module ShouldSucceed where + + +class Foo a where + +class Foz a + +x = 2 where +y = 3 + +instance Foo Int where diff --git a/ghc/tests/rename/should_compile/rn035.hs b/ghc/tests/rename/should_compile/rn035.hs new file mode 100644 index 0000000..2ba776d --- /dev/null +++ b/ghc/tests/rename/should_compile/rn035.hs @@ -0,0 +1,10 @@ +-- !!! Checking what's legal in the body of a class declaration. +module ShouldSucceed where + +class Foo a where { + (--<>--) :: a -> a -> Int ; + infixl 5 --<>-- ; + (--<>--) _ _ = 2 ; -- empty decl at the end. +}; + + diff --git a/ghc/tests/rename/should_compile/rn036.hs b/ghc/tests/rename/should_compile/rn036.hs new file mode 100644 index 0000000..ea6c04d --- /dev/null +++ b/ghc/tests/rename/should_compile/rn036.hs @@ -0,0 +1,13 @@ +-- !!! Checking that qualified method names are legal in instance body. +module ShouldSucceed where + +import Prelude hiding (Eq, (==)) +import Prelude as P (Eq,(==)) + +data Foo = Foo Int Integer + +instance P.Eq Foo where + (Foo a1 b1) P.== (Foo a2 b2) = a1 P.== a2 && b1 P.== b2 + + + -- 1.7.10.4