Commit 483ff634 authored by Simon Marlow's avatar Simon Marlow
Browse files

add a :list test

parent 84e1d6d4
......@@ -33,3 +33,5 @@ test('dynbrk003', extra_run_opts('-fno-warn-monomorphism-restriction'), ghci_scr
test('dynbrk004', extra_run_opts('-fno-warn-monomorphism-restriction'), ghci_script, ['dynbrk004.script'])
test('result001', extra_run_opts('-fno-warn-monomorphism-restriction'), ghci_script, ['result001.script'])
test('list001', extra_run_opts('-fno-warn-monomorphism-restriction'), ghci_script, ['list001.script'])
:list
-- should fail, nothing to list
:list Data.List 20
-- can't list a compiled module
:list Data.List.map
-- can't list a compiled module
:l ../Test3.hs
:list mymap
:list main
:list 4
-- wrong syntax:
:list a b c
:list 10 20
not stopped at a breakpoint; nothing to list
module 'Data.List' is not interpreted
cannot list source code for map: module GHC.Base is not interpreted
1 mymap f [] = []
2 mymap f (x:xs) = f x:mymap f xs
3
3
4 main = mapM_ putStrLn $ mymap ('a':) ["hello","bye"]
5
3
4 main = mapM_ putStrLn $ mymap ('a':) ["hello","bye"]
5
syntax: :list [<line> | <module> <line> | <identifier>]
syntax: :list [<line> | <module> <line> | <identifier>]
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