Test cases for GHCi data, class, etc.
authorDaniel Winograd-Cort <dwc@cs.yale.edu>
Thu, 25 Aug 2011 16:30:41 +0000 (17:30 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 21 Sep 2011 00:14:32 +0000 (01:14 +0100)
Test cases for GHCi data, type, newtype, class, instance,
deriving, etc declarations.

44 files changed:
testsuite/ghci054.script [new file with mode: 0644]
testsuite/tests/ghci/prog009/ghci.prog009.stderr
testsuite/tests/ghci/scripts/2816.stderr
testsuite/tests/ghci/scripts/T4127a.stderr
testsuite/tests/ghci/scripts/T5130.stderr
testsuite/tests/ghci/scripts/all.T
testsuite/tests/ghci/scripts/ghci012.stdout
testsuite/tests/ghci/scripts/ghci039.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci039.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci040.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci040.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci041.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci041.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci042.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci042.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci043.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci043.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci044.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci044.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci045.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci045.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci046.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci046.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci047.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci047.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci047.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci048.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci048.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci049.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci049.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci050.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci050.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci050.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci051.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci051.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci051.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci052.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci052.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci052.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci053.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci053.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci053.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci054.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/ghci054.stdout [new file with mode: 0644]

diff --git a/testsuite/ghci054.script b/testsuite/ghci054.script
new file mode 100644 (file)
index 0000000..7c17087
--- /dev/null
@@ -0,0 +1,4 @@
+--Testing type synonyms
+type Foo = String
+let foo = "foo" :: Foo
+:t foo
index 484a1b9..e63a322 100644 (file)
@@ -1,7 +1,7 @@
 
 A.hs:1:16: parse error on input `where'
 
-<interactive>:1:1:
+<interactive>:26:1:
     Not in scope: `yan'
     Perhaps you meant `tan' (imported from Prelude)
 
index b9c60ee..3a9e972 100644 (file)
@@ -1,2 +1,2 @@
 
-<interactive>:1:1: Not in scope: `α'
+<interactive>:2:1: Not in scope: `α'
index bd96443..57fbf12 100644 (file)
@@ -1,7 +1,7 @@
-\r
-<interactive>:1:68:\r
-    Multiple declarations of `f'\r
-    Declared at: <interactive>:1:32\r
-                 <interactive>:1:68\r
-\r
-<interactive>:1:108: `f' is not a (visible) method of class `Foo'\r
+
+<interactive>:3:68:
+    Multiple declarations of `f'
+    Declared at: <interactive>:3:32
+                 <interactive>:3:68
+
+<interactive>:3:108: `f' is not a (visible) method of class `Foo'
index cf9e6b4..b68777e 100644 (file)
@@ -1,5 +1,5 @@
 
-<interactive>:1:27:
+<interactive>:3:27:
     Couldn't match type `a' with `[Char]'
     In the expression: "hi"
     In the expression: [x, "hi"]
index 980cb81..5c96d2a 100644 (file)
@@ -55,6 +55,23 @@ test('ghci035', normal, ghci_script, ['ghci035.script'])
 test('ghci036', normal, ghci_script, ['ghci036.script'])
 test('ghci037', req_interp, run_command, ['$MAKE -s --no-print-directory ghci037'])
 test('ghci038', normal, ghci_script, ['ghci038.script'])
+test('ghci039', normal, ghci_script, ['ghci039.script'])
+test('ghci040', normal, ghci_script, ['ghci040.script'])
+test('ghci041', normal, ghci_script, ['ghci041.script'])
+test('ghci042', normal, ghci_script, ['ghci042.script'])
+test('ghci043', normal, ghci_script, ['ghci043.script'])
+test('ghci044', normal, ghci_script, ['ghci044.script'])
+test('ghci045', normal, ghci_script, ['ghci045.script'])
+test('ghci046', normal, ghci_script, ['ghci046.script'])
+test('ghci047', normal, ghci_script, ['ghci047.script'])
+test('ghci048', normal, ghci_script, ['ghci048.script'])
+test('ghci049', normal, ghci_script, ['ghci049.script'])
+test('ghci050', normal, ghci_script, ['ghci050.script'])
+test('ghci051', normal, ghci_script, ['ghci051.script'])
+test('ghci052', normal, ghci_script, ['ghci052.script'])
+test('ghci053', normal, ghci_script, ['ghci053.script'])
+test('ghci054', normal, ghci_script, ['ghci054.script'])
+test('ghci055', normal, ghci_script, ['ghci055.script'])
 test('2452', normal, ghci_script, ['2452.script'])
 test('T2766', normal, ghci_script, ['T2766.script'])
 
index 32ceac8..407ef45 100644 (file)
@@ -1 +1 @@
-($$$) :: [b -> c] -> [b] -> [c]        -- Defined at <interactive>:1:8
+($$$) :: [b -> c] -> [b] -> [c]        -- Defined at <interactive>:2:8
diff --git a/testsuite/tests/ghci/scripts/ghci039.script b/testsuite/tests/ghci/scripts/ghci039.script
new file mode 100644 (file)
index 0000000..4699a80
--- /dev/null
@@ -0,0 +1,3 @@
+--Basic deriving test
+data T = A | B deriving Show
+show A
diff --git a/testsuite/tests/ghci/scripts/ghci039.stdout b/testsuite/tests/ghci/scripts/ghci039.stdout
new file mode 100644 (file)
index 0000000..d478a3d
--- /dev/null
@@ -0,0 +1 @@
+"A"
diff --git a/testsuite/tests/ghci/scripts/ghci040.script b/testsuite/tests/ghci/scripts/ghci040.script
new file mode 100644 (file)
index 0000000..cecb684
--- /dev/null
@@ -0,0 +1,4 @@
+--Testing type and constructor shadowing
+data T = A | B
+data T = B | C
+:i A
diff --git a/testsuite/tests/ghci/scripts/ghci040.stdout b/testsuite/tests/ghci/scripts/ghci040.stdout
new file mode 100644 (file)
index 0000000..6ea7879
--- /dev/null
@@ -0,0 +1,2 @@
+data main::Interactive.T = A | ...
+       -- Defined at <interactive>:3:10
diff --git a/testsuite/tests/ghci/scripts/ghci041.script b/testsuite/tests/ghci/scripts/ghci041.script
new file mode 100644 (file)
index 0000000..9e8a05a
--- /dev/null
@@ -0,0 +1,4 @@
+--Testing more shadowing
+data T = A | B
+data R = A | C
+:i A
diff --git a/testsuite/tests/ghci/scripts/ghci041.stdout b/testsuite/tests/ghci/scripts/ghci041.stdout
new file mode 100644 (file)
index 0000000..daf48fc
--- /dev/null
@@ -0,0 +1 @@
+data R = A | ...       -- Defined at <interactive>:4:10
diff --git a/testsuite/tests/ghci/scripts/ghci042.script b/testsuite/tests/ghci/scripts/ghci042.script
new file mode 100644 (file)
index 0000000..f33d742
--- /dev/null
@@ -0,0 +1,10 @@
+--Testing record fields
+data T = A {a :: Int}
+:i A
+:i a
+let a = 3
+:i a
+a
+data R = B {a :: Int}
+:i a
+:i T
diff --git a/testsuite/tests/ghci/scripts/ghci042.stdout b/testsuite/tests/ghci/scripts/ghci042.stdout
new file mode 100644 (file)
index 0000000..c6717da
--- /dev/null
@@ -0,0 +1,7 @@
+data T = A {...}       -- Defined at <interactive>:3:10
+data T = A {a :: Int}  -- Defined at <interactive>:3:13
+a :: Integer   -- Defined at <interactive>:6:5
+3
+data R = B {a :: Int}  -- Defined at <interactive>:9:13
+data T = A {main::Interactive.a :: Int}
+       -- Defined at <interactive>:3:6
diff --git a/testsuite/tests/ghci/scripts/ghci043.script b/testsuite/tests/ghci/scripts/ghci043.script
new file mode 100644 (file)
index 0000000..87f9877
--- /dev/null
@@ -0,0 +1,11 @@
+--Testing custom classes and instances as well as data type shadowing
+class C a
+instance C Int
+
+data Foo = Bar | Baz
+class MyEq a where ; myeq :: a -> a -> Bool ; a `myeq` b = True
+instance MyEq Foo
+Bar `myeq` Baz
+data Foo = Bar | Baz
+instance MyEq Foo where ; a `myeq` b = False
+Baz `myeq` Bar
diff --git a/testsuite/tests/ghci/scripts/ghci043.stdout b/testsuite/tests/ghci/scripts/ghci043.stdout
new file mode 100644 (file)
index 0000000..1cc8b5e
--- /dev/null
@@ -0,0 +1,2 @@
+True
+False
diff --git a/testsuite/tests/ghci/scripts/ghci044.script b/testsuite/tests/ghci/scripts/ghci044.script
new file mode 100644 (file)
index 0000000..7af66bb
--- /dev/null
@@ -0,0 +1,10 @@
+--Testing flexible and Overlapping instances
+class C a where { f :: a -> Int; f _ = 3 }
+instance C Int where { f = id }
+instance C [Int]
+:set -XFlexibleInstances
+instance C [Int]
+instance C a => C [a] where f xs = length xs
+-- ***This should be an overlapping instances error!***
+:set -XOverlappingInstances
+instance C a => C [a] where f xs = length xs
diff --git a/testsuite/tests/ghci/scripts/ghci044.stderr b/testsuite/tests/ghci/scripts/ghci044.stderr
new file mode 100644 (file)
index 0000000..dfcbd10
--- /dev/null
@@ -0,0 +1,13 @@
+
+<interactive>:5:10:
+    Illegal instance declaration for `C [Int]'
+      (All instance types must be of the form (T a1 ... an)
+       where a1 ... an are *distinct type variables*,
+       and each type variable appears at most once in the instance head.
+       Use -XFlexibleInstances if you want to disable this.)
+    In the instance declaration for `C [Int]'
+
+<interactive>:8:10:
+    Overlapping instance declarations:
+      instance C a => C [a] -- Defined at <interactive>:8:10
+      instance C [Int] -- Defined at <interactive>:7:10
diff --git a/testsuite/tests/ghci/scripts/ghci045.script b/testsuite/tests/ghci/scripts/ghci045.script
new file mode 100644 (file)
index 0000000..042d16c
--- /dev/null
@@ -0,0 +1,6 @@
+--Testing standalone deriving
+:set -XStandaloneDeriving
+data Foo = A | B | C
+deriving instance Show Foo
+A
+C
diff --git a/testsuite/tests/ghci/scripts/ghci045.stdout b/testsuite/tests/ghci/scripts/ghci045.stdout
new file mode 100644 (file)
index 0000000..8ec30d8
--- /dev/null
@@ -0,0 +1,2 @@
+A
+C
diff --git a/testsuite/tests/ghci/scripts/ghci046.script b/testsuite/tests/ghci/scripts/ghci046.script
new file mode 100644 (file)
index 0000000..f07e06f
--- /dev/null
@@ -0,0 +1,22 @@
+--Testing type families and their shadowing
+:set -XTypeFamilies
+data HTrue
+data HFalse
+type family AND a b
+type instance AND HTrue  HTrue  = HTrue
+type instance AND HTrue  HFalse = HFalse
+type instance AND HFalse HTrue  = HFalse
+type instance AND HFalse HFalse = HFalse
+type family OR a b
+type instance OR HTrue  HTrue  = HTrue
+type instance OR HTrue  HFalse = HTrue
+type instance OR HFalse HTrue  = HTrue
+type instance OR HFalse HFalse = HFalse
+:t undefined :: AND HTrue HTrue
+:t undefined :: AND (OR HFalse HTrue) (OR HTrue HFalse)
+let t = undefined :: AND HTrue HTrue
+let f = undefined :: AND HTrue HFalse
+type instance AND HTrue  HTrue  = HFalse
+:t t
+let t = undefined :: AND HTrue HTrue
+:t t
diff --git a/testsuite/tests/ghci/scripts/ghci046.stdout b/testsuite/tests/ghci/scripts/ghci046.stdout
new file mode 100644 (file)
index 0000000..d600596
--- /dev/null
@@ -0,0 +1,4 @@
+undefined :: AND HTrue HTrue :: HTrue
+undefined :: AND (OR HFalse HTrue) (OR HTrue HFalse) :: HTrue
+t :: HTrue
+t :: HFalse
diff --git a/testsuite/tests/ghci/scripts/ghci047.script b/testsuite/tests/ghci/scripts/ghci047.script
new file mode 100644 (file)
index 0000000..49d9304
--- /dev/null
@@ -0,0 +1,40 @@
+--Testing GADTs, type families as well as a ton of crazy type stuff
+:set -XGADTs
+:set -XTypeFamilies
+:set -XOverlappingInstances
+:set -XFunctionalDependencies
+:set -XFlexibleContexts
+:set -XFlexibleInstances
+:set -XUndecidableInstances
+data A
+data B
+data C
+:{
+data ABorC t where
+  Foo :: Int -> ABorC A
+  Bar :: Bool -> ABorC A
+  Baz :: Char -> ABorC B
+  Quz :: ABorC B
+  Yud :: String -> ABorC C
+  Myp :: Double -> ABorC C
+:}
+data HTrue
+data HFalse
+
+class TypeEq x y b | x y -> b
+instance (HTrue ~ b)  => TypeEq x x b
+instance (HFalse ~ b) => TypeEq x y b
+
+type family Or a b
+type instance Or HTrue  HTrue  = HTrue
+type instance Or HTrue  HFalse = HTrue
+type instance Or HFalse HTrue  = HTrue
+type instance Or HFalse HFalse = HFalse
+
+let f :: (Or a c ~ HTrue, TypeEq t A a, TypeEq t C c) => ABorC t -> Int ;    f x = 1
+f $ Foo 1
+f $ Bar True
+f $ Baz 'a'
+f $ Quz
+f $ Yud "a"
+f $ Myp 4.3
diff --git a/testsuite/tests/ghci/scripts/ghci047.stderr b/testsuite/tests/ghci/scripts/ghci047.stderr
new file mode 100644 (file)
index 0000000..1807dcb
--- /dev/null
@@ -0,0 +1,12 @@
+
+<interactive>:38:1:
+    Couldn't match type `HFalse' with `HTrue'
+    In the expression: f
+    In the expression: f $ Baz 'a'
+    In an equation for `it': it = f $ Baz 'a'
+
+<interactive>:39:1:
+    Couldn't match type `HFalse' with `HTrue'
+    In the expression: f
+    In the expression: f $ Quz
+    In an equation for `it': it = f $ Quz
diff --git a/testsuite/tests/ghci/scripts/ghci047.stdout b/testsuite/tests/ghci/scripts/ghci047.stdout
new file mode 100644 (file)
index 0000000..98fb6a6
--- /dev/null
@@ -0,0 +1,4 @@
+1
+1
+1
+1
diff --git a/testsuite/tests/ghci/scripts/ghci048.script b/testsuite/tests/ghci/scripts/ghci048.script
new file mode 100644 (file)
index 0000000..0a1cfc5
--- /dev/null
@@ -0,0 +1,5 @@
+--Testing proper error message for multiple declarations (a previous bug)
+data Foo = A | B
+data Foo = A | A
+data Foo = A | B
+data Foo = A | A
diff --git a/testsuite/tests/ghci/scripts/ghci048.stderr b/testsuite/tests/ghci/scripts/ghci048.stderr
new file mode 100644 (file)
index 0000000..408c1e9
--- /dev/null
@@ -0,0 +1,10 @@
+
+<interactive>:4:16:
+    Multiple declarations of `A'
+    Declared at: <interactive>:4:12
+                 <interactive>:4:16
+
+<interactive>:6:16:
+    Multiple declarations of `A'
+    Declared at: <interactive>:6:12
+                 <interactive>:6:16
diff --git a/testsuite/tests/ghci/scripts/ghci049.script b/testsuite/tests/ghci/scripts/ghci049.script
new file mode 100644 (file)
index 0000000..5a3029a
--- /dev/null
@@ -0,0 +1,9 @@
+--Testing RecordWildCards (a previous bug)
+data C = C {a :: Integer, b :: Integer, c :: Integer, d :: Integer} deriving Show
+let myc = C 1 2 3 4
+:set -XFlexibleInstances
+instance Show (C -> Integer) where ; show a = "C -> field " ++ (show $ a myc)
+(a,b,c,d)
+:set -XRecordWildCards
+let C{..} = myc
+(a,b,c,d)
diff --git a/testsuite/tests/ghci/scripts/ghci049.stdout b/testsuite/tests/ghci/scripts/ghci049.stdout
new file mode 100644 (file)
index 0000000..edd14cc
--- /dev/null
@@ -0,0 +1,2 @@
+(C -> field 1,C -> field 2,C -> field 3,C -> field 4)
+(1,2,3,4)
diff --git a/testsuite/tests/ghci/scripts/ghci050.script b/testsuite/tests/ghci/scripts/ghci050.script
new file mode 100644 (file)
index 0000000..277e803
--- /dev/null
@@ -0,0 +1,7 @@
+--Testing for proper name printing in complex error messages (a previous bug)
+:set -XTypeFamilies
+:set -XFlexibleInstances
+class Listable t where ; type ListableElem t :: * ; asList :: t -> [ListableElem t]
+instance Listable (a,a) where ; asList (a,b) = [a,b]
+instance Listable (a,a) where ; type ListableElem (a,a) = a ; asList (a,b) = [a,b]
+asList ("as","df")
diff --git a/testsuite/tests/ghci/scripts/ghci050.stderr b/testsuite/tests/ghci/scripts/ghci050.stderr
new file mode 100644 (file)
index 0000000..7825133
--- /dev/null
@@ -0,0 +1,8 @@
+
+<interactive>:6:51:
+    Couldn't match type `a' with `ListableElem (a, a)'
+      `a' is a rigid type variable bound by
+          the instance declaration at <interactive>:6:20
+    In the expression: b
+    In the expression: [a, b]
+    In an equation for `asList': asList (a, b) = [a, b]
diff --git a/testsuite/tests/ghci/scripts/ghci050.stdout b/testsuite/tests/ghci/scripts/ghci050.stdout
new file mode 100644 (file)
index 0000000..c71a50a
--- /dev/null
@@ -0,0 +1 @@
+["as","df"]
diff --git a/testsuite/tests/ghci/scripts/ghci051.script b/testsuite/tests/ghci/scripts/ghci051.script
new file mode 100644 (file)
index 0000000..6833879
--- /dev/null
@@ -0,0 +1,18 @@
+--Testing complex type and constructor shadowing
+data T = A | B
+type T' = T
+let b = B :: T'
+data   T = B | C
+let c = C :: T'
+let c = C
+data     T = C | D
+let d = D
+:i T
+:i T'
+:i A
+:i B
+:i C
+:i D
+:i b
+:i c
+:i d
diff --git a/testsuite/tests/ghci/scripts/ghci051.stderr b/testsuite/tests/ghci/scripts/ghci051.stderr
new file mode 100644 (file)
index 0000000..e52b3ed
--- /dev/null
@@ -0,0 +1,5 @@
+
+<interactive>:7:9:
+    Couldn't match expected type `T'' with actual type `T'
+    In the expression: C :: T'
+    In an equation for `c': c = C :: T'
diff --git a/testsuite/tests/ghci/scripts/ghci051.stdout b/testsuite/tests/ghci/scripts/ghci051.stdout
new file mode 100644 (file)
index 0000000..1098275
--- /dev/null
@@ -0,0 +1,9 @@
+data T = C | D  -- Defined at <interactive>:0:10
+type T' = :Interactive.T        -- Defined at <interactive>:0:6-7
+data :Interactive.T = A | ...   -- Defined at <interactive>:0:10
+data :Interactive.T = B | ...   -- Defined at <interactive>:0:12
+data T = C | ...        -- Defined at <interactive>:0:14
+data T = ... | D        -- Defined at <interactive>:0:18
+b :: T'         -- Defined at <interactive>:0:5
+c :: :Interactive.T     -- Defined at <interactive>:0:5
+d :: T  -- Defined at <interactive>:0:5
diff --git a/testsuite/tests/ghci/scripts/ghci052.script b/testsuite/tests/ghci/scripts/ghci052.script
new file mode 100644 (file)
index 0000000..53e0093
--- /dev/null
@@ -0,0 +1,10 @@
+--Testing data type and constructor shadowing with functions
+data Planet = Mercury | Venus | Earth
+let pn Mercury = "M" ; pn Venus = "V" ; pn Earth = "E"
+pn Mercury
+data Planet = Mercury | Venus | Mars
+pn Mercury
+pn Venus
+pn Mars
+pn Earth
+let pn Mercury = "M" ; pn Venus = "V" ; pn Earth = "E" ; pn Mars = "M"
diff --git a/testsuite/tests/ghci/scripts/ghci052.stderr b/testsuite/tests/ghci/scripts/ghci052.stderr
new file mode 100644 (file)
index 0000000..c685a2a
--- /dev/null
@@ -0,0 +1,27 @@
+
+<interactive>:7:4:
+    Couldn't match expected type `main::Interactive.Planet'
+                with actual type `Planet'
+    In the first argument of `pn', namely `Mercury'
+    In the expression: pn Mercury
+    In an equation for `it': it = pn Mercury
+
+<interactive>:8:4:
+    Couldn't match expected type `main::Interactive.Planet'
+                with actual type `Planet'
+    In the first argument of `pn', namely `Venus'
+    In the expression: pn Venus
+    In an equation for `it': it = pn Venus
+
+<interactive>:9:4:
+    Couldn't match expected type `main::Interactive.Planet'
+                with actual type `Planet'
+    In the first argument of `pn', namely `Mars'
+    In the expression: pn Mars
+    In an equation for `it': it = pn Mars
+
+<interactive>:11:44:
+    Couldn't match expected type `Planet'
+                with actual type `main::Interactive.Planet'
+    In the pattern: Earth
+    In an equation for `pn': pn Earth = "E"
diff --git a/testsuite/tests/ghci/scripts/ghci052.stdout b/testsuite/tests/ghci/scripts/ghci052.stdout
new file mode 100644 (file)
index 0000000..b16e7f2
--- /dev/null
@@ -0,0 +1,2 @@
+"M"
+"E"
diff --git a/testsuite/tests/ghci/scripts/ghci053.script b/testsuite/tests/ghci/scripts/ghci053.script
new file mode 100644 (file)
index 0000000..cf104b5
--- /dev/null
@@ -0,0 +1,10 @@
+--Testing deriving in the presence of shadowing
+data Planet = Mercury | Venus | Earth deriving Eq
+let mercury = Mercury
+Venus == Earth
+data Planet = Mercury | Venus deriving Eq
+Mercury == Mercury
+mercury == Mercury
+Mercury == Venus
+Venus == Earth
+Earth == Earth
diff --git a/testsuite/tests/ghci/scripts/ghci053.stderr b/testsuite/tests/ghci/scripts/ghci053.stderr
new file mode 100644 (file)
index 0000000..e08ad91
--- /dev/null
@@ -0,0 +1,14 @@
+
+<interactive>:8:12:
+    Couldn't match expected type `main::Interactive.Planet'
+                with actual type `Planet'
+    In the second argument of `(==)', namely `Mercury'
+    In the expression: mercury == Mercury
+    In an equation for `it': it = mercury == Mercury
+
+<interactive>:10:10:
+    Couldn't match expected type `Planet'
+                with actual type `main::Interactive.Planet'
+    In the second argument of `(==)', namely `Earth'
+    In the expression: Venus == Earth
+    In an equation for `it': it = Venus == Earth
diff --git a/testsuite/tests/ghci/scripts/ghci053.stdout b/testsuite/tests/ghci/scripts/ghci053.stdout
new file mode 100644 (file)
index 0000000..0244e7b
--- /dev/null
@@ -0,0 +1,4 @@
+False
+True
+False
+True
\ No newline at end of file
diff --git a/testsuite/tests/ghci/scripts/ghci054.script b/testsuite/tests/ghci/scripts/ghci054.script
new file mode 100644 (file)
index 0000000..7c17087
--- /dev/null
@@ -0,0 +1,4 @@
+--Testing type synonyms
+type Foo = String
+let foo = "foo" :: Foo
+:t foo
diff --git a/testsuite/tests/ghci/scripts/ghci054.stdout b/testsuite/tests/ghci/scripts/ghci054.stdout
new file mode 100644 (file)
index 0000000..9ffc47d
--- /dev/null
@@ -0,0 +1 @@
+foo :: Foo