Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : ghc-defer

http://hackage.haskell.org/trac/ghc/changeset/ba9aa6affaa4458532f1a846faca7b6eb347493e

>---------------------------------------------------------------

commit ba9aa6affaa4458532f1a846faca7b6eb347493e
Author: Jose Pedro Magalhaes <[email protected]>
Date:   Thu Dec 22 11:39:27 2011 +0000

    Tests for -fwarn-type-errors

>---------------------------------------------------------------

 tests/ghci/scripts/Defer02.script         |   14 ++++++++
 tests/ghci/scripts/all.T                  |    1 +
 tests/typecheck/should_run/Defer01.hs     |   53 +++++++++++++++++++++++++++++
 tests/typecheck/should_run/Defer01.stdout |    1 +
 tests/typecheck/should_run/all.T          |    3 +-
 5 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/tests/ghci/scripts/Defer02.script 
b/tests/ghci/scripts/Defer02.script
new file mode 100755
index 0000000..3fc6aff
--- /dev/null
+++ b/tests/ghci/scripts/Defer02.script
@@ -0,0 +1,14 @@
+-- Test -fwarn-type-errors
+-- This test shows how each error is printed at runtime
+:l ../../typecheck/should_run/Defer01
+t5624
+print a
+print (b B)
+print (c (C2 True))
+print (d ())
+print f
+print (h ())
+print (i ())
+print j
+print (k 2)
+l
\ No newline at end of file
diff --git a/tests/ghci/scripts/all.T b/tests/ghci/scripts/all.T
old mode 100644
new mode 100755
index d8c1501..b559dcf
--- a/tests/ghci/scripts/all.T
+++ b/tests/ghci/scripts/all.T
@@ -108,3 +108,4 @@ test('T5557', normal, ghci_script, ['T5557.script'])
 test('T5566', normal, ghci_script, ['T5566.script'])
 test('GhciKinds', normal, ghci_script, ['GhciKinds.script'])
 test('T5564', normal, ghci_script, ['T5564.script'])
+test('Defer02', normal, ghci_script, ['Defer02.script'])
\ No newline at end of file
diff --git a/tests/typecheck/should_run/Defer01.hs 
b/tests/typecheck/should_run/Defer01.hs
new file mode 100755
index 0000000..e8cdcf6
--- /dev/null
+++ b/tests/typecheck/should_run/Defer01.hs
@@ -0,0 +1,53 @@
+-- Test -fwarn-type-errors
+-- Should compile and run
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE GADTs #-}
+{-# OPTIONS_GHC -fwarn-type-errors #-}
+
+module Main where
+
+t5624 :: IO ()
+t5624 = putStr "Hello World" >> putStr ','
+
+a :: Int
+a = 'p'
+
+data B = B
+b :: B -> Bool
+b x = x == x
+
+data C a where
+  C1 :: C Int
+  C2 :: Bool -> C Bool
+
+c :: C Int -> Bool
+c (C2 x) = True
+
+d :: a -> a
+d = 1
+
+e = 'p'
+f = e 'q'
+
+h :: a -> (Char,Char) 
+h x = (x,'c')
+
+data T a where 
+  K  :: a -> T a
+
+i a = seq (not (K a)) ()
+
+class MyClass a where myOp :: a -> String
+
+j = myOp 23 -- Two errors, should not combine them
+
+k :: (Int ~ Bool) => Int -> Bool
+k x = x
+
+l :: IO ()
+l = putChar >> putChar 'p'
+
+
+main :: IO ()
+main = print "No errors!"
diff --git a/tests/typecheck/should_run/Defer01.stdout 
b/tests/typecheck/should_run/Defer01.stdout
new file mode 100644
index 0000000..19c3777
--- /dev/null
+++ b/tests/typecheck/should_run/Defer01.stdout
@@ -0,0 +1 @@
+"No errors!"
diff --git a/tests/typecheck/should_run/all.T b/tests/typecheck/should_run/all.T
old mode 100644
new mode 100755
index aacdc7d..d13b317
--- a/tests/typecheck/should_run/all.T
+++ b/tests/typecheck/should_run/all.T
@@ -11,6 +11,7 @@ test('tcrun002', only_compiler_types(['ghc']), 
compile_and_run, [''])
 test('tcrun003', normal, compile_and_run, [''])
 test('tcrun004', normal, compile_and_run, [''])
 test('tcrun005', normal, compile_and_run, [''])
+test('Defer01', normal, compile_and_run, [''])
 
 # -----------------------------------------------------------------------------
 # Skip everything else if fast is on
@@ -84,4 +85,4 @@ test('T3500a', normal, compile_and_run, [''])
 test('T3500b', normal, compile_and_run, [''])
 test('T4809', reqlib('mtl'), compile_and_run, [''])
 test('T2722', normal, compile_and_run, [''])
-test('mc17', normal, compile_and_run, [''])
+test('mc17', normal, compile_and_run, [''])
\ No newline at end of file



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to