summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2019-11-08 09:22:02 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-09 18:04:14 -0500
commit1f98e47df40ae84423283bf2e06ffe7a0b4a9381 (patch)
tree561b4fa063ef9dfda47c8f716db08ffddb6d23f6 /testsuite/tests/ghci/scripts
parent011f3121955cf08353e384e9b84ed387860ade45 (diff)
downloadhaskell-1f98e47df40ae84423283bf2e06ffe7a0b4a9381.tar.gz
Use the right type in :force
A missing prime meant that we were considering the wrong type in the GHCi debugger, when doing :force on multiple arguments (issue #17431). The fix is trivial.
Diffstat (limited to 'testsuite/tests/ghci/scripts')
-rw-r--r--testsuite/tests/ghci/scripts/T17431.hs10
-rw-r--r--testsuite/tests/ghci/scripts/T17431.script4
-rw-r--r--testsuite/tests/ghci/scripts/T17431.stdout11
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
4 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T17431.hs b/testsuite/tests/ghci/scripts/T17431.hs
new file mode 100644
index 0000000000..78050576df
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T17431.hs
@@ -0,0 +1,10 @@
+module T17431 (sort) where
+
+sort :: Ord a => [a] -> [a]
+sort [] = []
+sort (x:xs) = insert x (sort xs)
+
+insert :: Ord a => a -> [a] -> [a]
+insert x [] = [x]
+insert x (y:ys) | x < y = x:y:ys
+ | otherwise = y:(insert x ys)
diff --git a/testsuite/tests/ghci/scripts/T17431.script b/testsuite/tests/ghci/scripts/T17431.script
new file mode 100644
index 0000000000..a53dcf4214
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T17431.script
@@ -0,0 +1,4 @@
+:l T17431
+:br 5
+sort [3,2,1]
+:force x xs _result
diff --git a/testsuite/tests/ghci/scripts/T17431.stdout b/testsuite/tests/ghci/scripts/T17431.stdout
new file mode 100644
index 0000000000..e6fa548b1a
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T17431.stdout
@@ -0,0 +1,11 @@
+Breakpoint 0 activated at T17431.hs:5:15-32
+Stopped in T17431.sort, T17431.hs:5:15-32
+_result :: [a] = _
+x :: a = _
+xs :: [a] = [_,_]
+*** Ignoring breakpoint
+*** Ignoring breakpoint
+*** Ignoring breakpoint
+x = 3
+xs = [2,1]
+_result = [1,2,3]
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index ae0e38cb4e..094f101abb 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -310,3 +310,4 @@ test('T16876', normal, ghci_script, ['T16876.script'])
test('T17345', normal, ghci_script, ['T17345.script'])
test('T17384', normal, ghci_script, ['T17384.script'])
test('T17403', normal, ghci_script, ['T17403.script'])
+test('T17431', normal, ghci_script, ['T17431.script'])