Commit 897c7a62 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add a test for :main and :run

parent 1351580c
......@@ -39,6 +39,7 @@ test('ghci026', normal, ghci_script, ['ghci026.script'])
test('ghci027', normal, ghci_script, ['ghci027.script'])
test('ghci028', normal, ghci_script, ['ghci028.script'])
test('ghci029', normal, ghci_script, ['ghci029.script'])
test('1914', if_compiler_ge('ghc', '6.9', expect_broken(2034)),
ghci_script, ['1914.script'])
-- :main and :run
let main = System.Environment.getArgs >>= print
:main foo bar
:main foo "bar baz"
:main ["foo", "bar baz"]
let foo = putStrLn "foo" >> System.Environment.getArgs >>= print
let bar = putStrLn "bar" >> System.Environment.getArgs >>= print
:set -main-is foo
:main foo "bar baz"
:run bar ["foo", "bar baz"]
["foo","bar baz"]
["foo","bar baz"]
["foo","bar baz"]
["foo","bar baz"]
Supports Markdown
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