From 183763c57a3dcda3ad6032a4b5a2dcc5c11079f6 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 30 Oct 2001 16:16:17 +0000 Subject: [PATCH] [project @ 2001-10-30 16:16:17 by simonmar] Add ':set args' and ':set prog' test. --- ghc/tests/ghci/ghci009.script | 20 ++++++++++++++++++++ ghc/tests/ghci/ghci009.stdout | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 ghc/tests/ghci/ghci009.script create mode 100644 ghc/tests/ghci/ghci009.stdout 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. -- 1.7.10.4