From: simonmar Date: Tue, 30 Oct 2001 16:16:17 +0000 (+0000) Subject: [project @ 2001-10-30 16:16:17 by simonmar] X-Git-Tag: Approximately_9120_patches~676 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=183763c57a3dcda3ad6032a4b5a2dcc5c11079f6;p=ghc-hetmet.git [project @ 2001-10-30 16:16:17 by simonmar] Add ':set args' and ':set prog' test. --- diff --git a/ghc/tests/ghci/ghci009.script b/ghc/tests/ghci/ghci009.script new file mode 100644 index 0000000..687e338 --- /dev/null +++ b/ghc/tests/ghci/ghci009.script @@ -0,0 +1,20 @@ +-- !!! test `:set args' and `:set prog' +System.getArgs +print it +System.getProgName +print it +:set args +System.getArgs +print it +System.getProgName +print it +:set args foo bar +System.getArgs +print it +System.getProgName +print it +:set prog foo +System.getArgs +print it +System.getProgName +print it diff --git a/ghc/tests/ghci/ghci009.stdout b/ghc/tests/ghci/ghci009.stdout new file mode 100644 index 0000000..4dd7111 --- /dev/null +++ b/ghc/tests/ghci/ghci009.stdout @@ -0,0 +1,36 @@ + ___ ___ _ + / _ \ /\ /\/ __(_) + / /_\// /_/ / / | | GHC Interactive, version 5.03, for Haskell 98. +/ /_\\/ __ / /___| | http://www.haskell.org/ghc/ +\____/\/ /_/\____/|_| Type :? for help. + +Loading package std ... linking ... done. +Prelude> -- !!! test `:set args' and `:set prog' +Prelude> System.getArgs +Prelude> print it +[] +Prelude> System.getProgName +Prelude> print it +"" +Prelude> :set args +Prelude> System.getArgs +Prelude> print it +[] +Prelude> System.getProgName +Prelude> print it +"" +Prelude> :set args foo bar +Prelude> System.getArgs +Prelude> print it +["foo","bar"] +Prelude> System.getProgName +Prelude> print it +"" +Prelude> :set prog foo +Prelude> System.getArgs +Prelude> print it +["foo","bar"] +Prelude> System.getProgName +Prelude> print it +"foo" +Prelude> Leaving GHCi.