diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-01-22 19:02:56 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-01-22 19:02:56 +0000 |
commit | e672241bf641399a53c97f4df69a2eea9397744e (patch) | |
tree | a17dfdddff4d67b42f269354ece2c82584f8b9ab /testsuite/tests/deriving/should_fail | |
parent | 27b0f0ba51ba80cb6325fd46ffc0a6552277d5ea (diff) | |
download | haskell-e672241bf641399a53c97f4df69a2eea9397744e.tar.gz |
Add another test for #1133
Diffstat (limited to 'testsuite/tests/deriving/should_fail')
-rw-r--r-- | testsuite/tests/deriving/should_fail/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T1133A.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T1133A.hs-boot | 4 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T1133A.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/all.T | 5 |
5 files changed, 26 insertions, 1 deletions
diff --git a/testsuite/tests/deriving/should_fail/Makefile b/testsuite/tests/deriving/should_fail/Makefile index 0f0995d29d..f9f554d5db 100644 --- a/testsuite/tests/deriving/should_fail/Makefile +++ b/testsuite/tests/deriving/should_fail/Makefile @@ -6,3 +6,8 @@ drvfail016: $(RM) -f drvfail016.hi-boot drvfail016.o-boot '$(TEST_HC)' $(TEST_HC_OPTS) -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$? +.PHONY: T1133A +T1133A: + $(TEST_HC) $(TEST_HC_OPTS) -c T1133A.hs-boot + -$(TEST_HC) $(TEST_HC_OPTS) -c T1133A.hs + diff --git a/testsuite/tests/deriving/should_fail/T1133A.hs b/testsuite/tests/deriving/should_fail/T1133A.hs new file mode 100644 index 0000000000..b5950ea1fb --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T1133A.hs @@ -0,0 +1,6 @@ + +module T1133A where + +import {-# SOURCE #-} T1133A + +newtype X = X Int deriving Enum diff --git a/testsuite/tests/deriving/should_fail/T1133A.hs-boot b/testsuite/tests/deriving/should_fail/T1133A.hs-boot new file mode 100644 index 0000000000..da89ec0fe3 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T1133A.hs-boot @@ -0,0 +1,4 @@ + +module T1133A where + +newtype X = X Int diff --git a/testsuite/tests/deriving/should_fail/T1133A.stderr b/testsuite/tests/deriving/should_fail/T1133A.stderr new file mode 100644 index 0000000000..734081ede5 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T1133A.stderr @@ -0,0 +1,7 @@ + +T1133A.hs:6:28: + Can't make a derived instance of `Enum X': + `X' must be an enumeration type + (an enumeration consists of one or more nullary, non-GADT constructors) + Try -XGeneralizedNewtypeDeriving for GHC's newtype-deriving extension + In the newtype declaration for `X' diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 5ddb2bd373..5fface82bf 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -36,4 +36,7 @@ test('T5287', normal, compile_fail, ['']) test('T5478', normal, compile_fail, ['']) test('T5686', normal, compile_fail, ['']) test('T5922', normal, compile_fail, ['']) - +test('T1133A', + extra_clean(['T1133A.o-boot', 'T1133A.hi-boot']), + run_command, + ['$MAKE --no-print-directory -s T1133A']) |