summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/should_run
diff options
context:
space:
mode:
authorDr. ERDI Gergo <gergo@erdi.hu>2014-12-22 19:01:37 +0800
committerDr. ERDI Gergo <gergo@erdi.hu>2014-12-22 19:01:37 +0800
commit707fb3aa2b058cb4245708d6a63019b3e32f795c (patch)
tree66c6f8697628a44dd3c547f001f1210824982b93 /testsuite/tests/ghci/should_run
parent6713f0d9ad4a2d875d8f7b245c1c0ca77ce1617f (diff)
downloadhaskell-707fb3aa2b058cb4245708d6a63019b3e32f795c.tar.gz
Strip leading whitespace before checking if a statement looks like a declaration (fixes #9914)
Diffstat (limited to 'testsuite/tests/ghci/should_run')
-rw-r--r--testsuite/tests/ghci/should_run/T9914.script9
-rw-r--r--testsuite/tests/ghci/should_run/T9914.stdout5
-rw-r--r--testsuite/tests/ghci/should_run/all.T1
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/should_run/T9914.script b/testsuite/tests/ghci/should_run/T9914.script
new file mode 100644
index 0000000000..d40f46f667
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T9914.script
@@ -0,0 +1,9 @@
+let x = 1
+x
+ let x = 2 -- Note leading whitespace
+x
+2
+data T1 = MkT1
+:i T1
+ data T2 = MkT2 -- Note leading whitespace
+:i T2
diff --git a/testsuite/tests/ghci/should_run/T9914.stdout b/testsuite/tests/ghci/should_run/T9914.stdout
new file mode 100644
index 0000000000..3dd5aff3f3
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T9914.stdout
@@ -0,0 +1,5 @@
+1
+2
+2
+data T1 = MkT1 -- Defined at <interactive>:7:1
+data T2 = MkT2 -- Defined at <interactive>:9:2
diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T
index effad6a725..b28e4a3893 100644
--- a/testsuite/tests/ghci/should_run/all.T
+++ b/testsuite/tests/ghci/should_run/all.T
@@ -20,4 +20,5 @@ test('T3171',
test('ghcirun004', just_ghci, compile_and_run, [''])
test('T8377', just_ghci, compile_and_run, [''])
+test('T9914', just_ghci, ghci_script, ['T9914.script'])
test('T9915', just_ghci, ghci_script, ['T9915.script'])