summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-08-24 11:39:29 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-08-24 11:45:05 +0200
commit65b737fa885f892ba786b6d5205d9126de54cc30 (patch)
treef0cd5c3fe9a2269de321ca18b772819eda39951f /testsuite/tests/ghci
parent77210adaf82f754df02d91c1fa649da561f87edf (diff)
downloadhaskell-65b737fa885f892ba786b6d5205d9126de54cc30.tar.gz
Add regression test for #8113
Depends on fix in 3229eadbff857b110f20ffddb80d5f7abd5d7216 to pass
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r--testsuite/tests/ghci/scripts/T8113.script18
-rw-r--r--testsuite/tests/ghci/scripts/T8113.stdout21
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
3 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T8113.script b/testsuite/tests/ghci/scripts/T8113.script
new file mode 100644
index 0000000000..9392c23c41
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T8113.script
@@ -0,0 +1,18 @@
+:def type (\e -> putStrLn ("called :type for "++show e++" (ignoring)") >> return "")
+:def
+:t ()
+:ty True
+:typ ()
+:type False
+:def! type (\e -> putStrLn ("called :type for "++show e++" (chaining)") >> return ("::type "++e))
+:def
+:t ()
+:ty True
+:typ ()
+:type False
+:undef type
+:def
+:t ()
+:ty True
+:typ ()
+:type False
diff --git a/testsuite/tests/ghci/scripts/T8113.stdout b/testsuite/tests/ghci/scripts/T8113.stdout
new file mode 100644
index 0000000000..8260a35d04
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T8113.stdout
@@ -0,0 +1,21 @@
+the following macros are defined:
+type
+called :type for "()" (ignoring)
+called :type for "True" (ignoring)
+called :type for "()" (ignoring)
+called :type for "False" (ignoring)
+the following macros are defined:
+type
+called :type for "()" (chaining)
+() :: ()
+called :type for "True" (chaining)
+True :: Bool
+called :type for "()" (chaining)
+() :: ()
+called :type for "False" (chaining)
+False :: Bool
+no macros defined
+() :: ()
+True :: Bool
+() :: ()
+False :: Bool
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index fe4d0fbfc4..1577a63274 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -152,3 +152,4 @@ test('T7873', normal, ghci_script, ['T7873.script'])
test('T7939', normal, ghci_script, ['T7939.script'])
test('T7894', normal, ghci_script, ['T7894.script'])
test('T8116', normal, ghci_script, ['T8116.script'])
+test('T8113', normal, ghci_script, ['T8113.script'])