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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6f0791309d2423eaf9e05573f715c167654eebe7

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

commit 6f0791309d2423eaf9e05573f715c167654eebe7
Author: Simon Marlow <[email protected]>
Date:   Wed Feb 29 15:14:48 2012 +0000

    add a test for :seti

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

 tests/ghci/scripts/all.T          |    2 +
 tests/ghci/scripts/ghci057.hs     |    4 +++
 tests/ghci/scripts/ghci057.script |   27 +++++++++++++++++++
 tests/ghci/scripts/ghci057.stdout |   53 +++++++++++++++++++++++++++++++++++++
 4 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/tests/ghci/scripts/all.T b/tests/ghci/scripts/all.T
index 4123e84..a2efb2a 100755
--- a/tests/ghci/scripts/all.T
+++ b/tests/ghci/scripts/all.T
@@ -81,6 +81,8 @@ test('ghci056',
      ],
      ghci_script, ['ghci056.script'])
 
+test('ghci057', normal, ghci_script, ['ghci057.script'])
+
 test('2452', normal, ghci_script, ['2452.script'])
 test('T2766', normal, ghci_script, ['T2766.script'])
 
diff --git a/tests/ghci/scripts/ghci057.hs b/tests/ghci/scripts/ghci057.hs
new file mode 100644
index 0000000..2a6b836
--- /dev/null
+++ b/tests/ghci/scripts/ghci057.hs
@@ -0,0 +1,4 @@
+module Test where
+data T a where
+  C :: T Int
+
diff --git a/tests/ghci/scripts/ghci057.script 
b/tests/ghci/scripts/ghci057.script
new file mode 100644
index 0000000..547fce5
--- /dev/null
+++ b/tests/ghci/scripts/ghci057.script
@@ -0,0 +1,27 @@
+:set
+
+putStrLn "Should fail, GADTs is not enabled"
+data T a where C :: T Int
+
+:set -XGADTs
+:set
+
+putStrLn "Should work, GADTs is in force from :set"
+:load ghci057.hs
+
+:set -XNoGADTs
+:set
+
+putStrLn "Should fail, GADTs is now disabled"
+:load ghci057.hs
+
+:seti -XGADTs
+:seti
+
+putStrLn "Should fail, GADTs is only enabled at the prompt"
+:load ghci057.hs
+
+-- Should work
+data T a where C :: T Int
+:t C
+
diff --git a/tests/ghci/scripts/ghci057.stdout 
b/tests/ghci/scripts/ghci057.stdout
new file mode 100644
index 0000000..f97ea30
--- /dev/null
+++ b/tests/ghci/scripts/ghci057.stdout
@@ -0,0 +1,53 @@
+options currently set: none.
+base language is: Haskell2010
+with the following modifiers:
+  -XNoDatatypeContexts
+  -XNondecreasingIndentation
+GHCi-specific dynamic flag settings:
+other dynamic, non-language, flag settings:
+  -fno-ghci-history
+  -fimplicit-import-qualified
+warning settings:
+Should fail, GADTs is not enabled
+options currently set: none.
+base language is: Haskell2010
+with the following modifiers:
+  -XGADTs
+  -XGADTSyntax
+  -XNoDatatypeContexts
+  -XNondecreasingIndentation
+  -XMonoLocalBinds
+GHCi-specific dynamic flag settings:
+other dynamic, non-language, flag settings:
+  -fno-ghci-history
+  -fimplicit-import-qualified
+warning settings:
+Should work, GADTs is in force from :set
+options currently set: none.
+base language is: Haskell2010
+with the following modifiers:
+  -XGADTSyntax
+  -XNoDatatypeContexts
+  -XNondecreasingIndentation
+  -XMonoLocalBinds
+GHCi-specific dynamic flag settings:
+other dynamic, non-language, flag settings:
+  -fno-ghci-history
+  -fimplicit-import-qualified
+warning settings:
+Should fail, GADTs is now disabled
+base language is: Haskell2010
+with the following modifiers:
+  -XGADTs
+  -XGADTSyntax
+  -XNoDatatypeContexts
+  -XNondecreasingIndentation
+  -XMonoLocalBinds
+  -XExtendedDefaultRules
+GHCi-specific dynamic flag settings:
+other dynamic, non-language, flag settings:
+  -fno-ghci-history
+  -fimplicit-import-qualified
+warning settings:
+Should fail, GADTs is only enabled at the prompt
+C :: T Int



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

Reply via email to