[project @ 2001-10-30 16:16:17 by simonmar]
authorsimonmar <unknown>
Tue, 30 Oct 2001 16:16:17 +0000 (16:16 +0000)
committersimonmar <unknown>
Tue, 30 Oct 2001 16:16:17 +0000 (16:16 +0000)
Add ':set args' and ':set prog' test.

ghc/tests/ghci/ghci009.script [new file with mode: 0644]
ghc/tests/ghci/ghci009.stdout [new file with mode: 0644]

diff --git a/ghc/tests/ghci/ghci009.script b/ghc/tests/ghci/ghci009.script
new file mode 100644 (file)
index 0000000..687e338
--- /dev/null
@@ -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 (file)
index 0000000..4dd7111
--- /dev/null
@@ -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
+"<interactive>"
+Prelude> :set args
+Prelude> System.getArgs
+Prelude> print it
+[]
+Prelude> System.getProgName
+Prelude> print it
+"<interactive>"
+Prelude> :set args foo bar
+Prelude> System.getArgs
+Prelude> print it
+["foo","bar"]
+Prelude> System.getProgName
+Prelude> print it
+"<interactive>"
+Prelude> :set prog foo
+Prelude> System.getArgs
+Prelude> print it
+["foo","bar"]
+Prelude> System.getProgName
+Prelude> print it
+"foo"
+Prelude> Leaving GHCi.