Commit 0860284d authored by Simon Marlow's avatar Simon Marlow

test case for #1743

parent 2dc254ee
......@@ -56,6 +56,7 @@ test('break020', normal, ghci_script, ['break020.script'])
test('break021', normal, ghci_script, ['break021.script'])
test('break024', normal, ghci_script, ['break024.script'])
test('break025', expect_broken(1681), ghci_script, ['break025.script'])
test('break026', expect_broken(1681), ghci_script, ['break026.script'])
test('dynbrk001', normal, ghci_script, ['dynbrk001.script'])
test('dynbrk002', normal, ghci_script, ['dynbrk002.script'])
......
module Test where
import Prelude hiding (foldl)
foldl f c xs = go c xs
where go c [] = c
go c (x:xs) = go (f c x) xs
:load break026
:step foldl (+) 0 [1..5]
:step
:step
:step
:step
:step
:force c
-- answer should be 1
:load break026
:step foldl (+) 0 [1..5]
:step
:step
:step
:step
:step
-- a diversion to single-step the evaluation of c:
:step c `seq` ()
:step
-- end diversion
c
-- answer should be 1 again (not 0)
Stopped at break026.hs:(5,0)-(7,34)
_result :: t1 = _
Stopped at break026.hs:5:15-21
_result :: t1 = _
c :: t1 = _
go :: t1 -> [t] -> t1 = _
xs :: [t] = _
Stopped at break026.hs:(6,8)-(7,34)
_result :: t1 = _
f :: t1 -> t -> t1 = _
Stopped at break026.hs:7:22-34
_result :: t1 = _
c :: t1 = _
f :: t1 -> Integer -> t1 = _
x :: Integer = 1
xs :: [Integer] = _
Stopped at break026.hs:(6,8)-(7,34)
_result :: t1 = _
f :: t1 -> t -> t1 = _
Stopped at break026.hs:7:22-34
_result :: t1 = _
c :: t1 = _
f :: t1 -> Integer -> t1 = _
x :: Integer = 2
xs :: [Integer] = _
c = 1
Stopped at break026.hs:(5,0)-(7,34)
_result :: t1 = _
Stopped at break026.hs:5:15-21
_result :: t1 = _
c :: t1 = _
go :: t1 -> [t] -> t1 = _
xs :: [t] = _
Stopped at break026.hs:(6,8)-(7,34)
_result :: t1 = _
f :: t1 -> t -> t1 = _
Stopped at break026.hs:7:22-34
_result :: t1 = _
c :: t1 = _
f :: t1 -> Integer -> t1 = _
x :: Integer = 1
xs :: [Integer] = _
Stopped at break026.hs:(6,8)-(7,34)
_result :: t1 = _
f :: t1 -> t -> t1 = _
Stopped at break026.hs:7:22-34
_result :: t1 = _
c :: t1 = _
f :: t1 -> Integer -> t1 = _
x :: Integer = 2
xs :: [Integer] = _
Stopped at break026.hs:7:26-30
_result :: t1 = _
c :: t1 = _
f :: t1 -> Integer -> t1 = _
x :: Integer = 1
()
1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment