Commit 1044bd1a authored by Simon Marlow's avatar Simon Marlow
Browse files

add test for bug #1010

parent b99a8229
......@@ -5,3 +5,8 @@ test('testblockalloc', compose(c_src,
compose(only_ways(['threaded1']),
extra_run_opts('+RTS -I0'))),
compile_and_run, [''])
# See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
# only GHCi triggers the bug, but we run the test all ways for completeness.
test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
module Main where
break2 p (x:xs) = if p x then
([],x:xs)
else
let (b1,b2) = break2 p xs
in (x : b1, b2)
break2 p [] = ([],[])
surprise xs = b1 ++ "\n surprise " ++ b2
where
(b1,b2) = break2 (=='\n') xs
test n = length $ surprise $ [head (show i) | i <-[1..n] ] ++ "\n the end"
main = print $ test 10000
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