Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/57e2b371e39fbc29aef4a76f6c61745739a42397 >--------------------------------------------------------------- commit 57e2b371e39fbc29aef4a76f6c61745739a42397 Author: Simon Peyton Jones <[email protected]> Date: Wed Aug 3 11:01:03 2011 +0100 Test Trac #5147 >--------------------------------------------------------------- tests/driver/T5147/A.hs | 7 +++++++ tests/driver/T5147/B1.hs | 8 ++++++++ tests/driver/T5147/B2.hs | 9 +++++++++ tests/driver/T5147/Makefile | 21 +++++++++++++++++++++ tests/driver/T5147/T5147.stderr | 7 +++++++ tests/driver/T5147/all.T | 5 +++++ 6 files changed, 57 insertions(+), 0 deletions(-) diff --git a/tests/driver/T5147/A.hs b/tests/driver/T5147/A.hs new file mode 100644 index 0000000..7a968df --- /dev/null +++ b/tests/driver/T5147/A.hs @@ -0,0 +1,7 @@ +module A where + +import B + +showField :: Fields v -> String +showField a = show a + diff --git a/tests/driver/T5147/B1.hs b/tests/driver/T5147/B1.hs new file mode 100644 index 0000000..67c283d --- /dev/null +++ b/tests/driver/T5147/B1.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TypeFamilies #-} +module B where + +class Entity v where + data Fields v + +instance Show (Fields v) where show = undefined + diff --git a/tests/driver/T5147/B2.hs b/tests/driver/T5147/B2.hs new file mode 100644 index 0000000..31857a3 --- /dev/null +++ b/tests/driver/T5147/B2.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module B where + +class Entity v where + data Fields v + +-- Remove instance +-- instance Show (Fields v) where show = undefined + diff --git a/tests/driver/T5147/Makefile b/tests/driver/T5147/Makefile new file mode 100644 index 0000000..e298ad7 --- /dev/null +++ b/tests/driver/T5147/Makefile @@ -0,0 +1,21 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Recompilation tests + +clean: + rm -f *.o *.hi + rm -f B.hs C + +# Removing an instance declaration should force recompilation +# failed in GHC 7.0 + +T5147: clean + cp B1.hs B.hs + '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs + sleep 1 + cp B2.hs B.hs + if '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs; then exit 1; else exit 0; fi +# Reverse the sense of the error; we *expect* +# the compilation to fail, and then we want to succeed diff --git a/tests/driver/T5147/T5147.stderr b/tests/driver/T5147/T5147.stderr new file mode 100644 index 0000000..b38cad9 --- /dev/null +++ b/tests/driver/T5147/T5147.stderr @@ -0,0 +1,7 @@ + +A.hs:6:15: + No instance for (Show (Fields v)) + arising from a use of `show' + Possible fix: add an instance declaration for (Show (Fields v)) + In the expression: show a + In an equation for `showField': showField a = show a diff --git a/tests/driver/T5147/all.T b/tests/driver/T5147/all.T new file mode 100644 index 0000000..40565ed --- /dev/null +++ b/tests/driver/T5147/all.T @@ -0,0 +1,5 @@ +test('T5147', + [clean_cmd('$MAKE -s clean')], + run_command, + ['$MAKE -s --no-print-directory T5147']) + _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
