Idris-dev/test/reg039/reg039.idr
David Raymond Christiansen ce414b82a6 Regression test for infinite regress in executor
This test will fail if laziness doesn't prevent infinite recursion in
the executor. It's implemented using `expect` instead of `timeout` in
the hope that it will make life easier for non-GNU systems.
2014-04-07 09:17:55 +02:00

13 lines
284 B
Idris

module LazyExec
-- The regression that this tests for is broken laziness in the executor.
covering
countdown : Int -> Lazy (List Int)
countdown n = if n > 0
then (n :: countdown (n-1))
else []
go : IO ()
go = putStrLn $ show (Force (countdown 3))