From 8889d5c01c9a4a45bd766c407b3b8cb3a1c52355 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 23 Mar 2001 12:29:07 +0000 Subject: [PATCH] [project @ 2001-03-23 12:29:07 by simonmar] Add test for :def, :undef --- ghc/tests/ghci/ghci005.script | 13 +++++++++++++ ghc/tests/ghci/ghci005.stdout | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 ghc/tests/ghci/ghci005.script create mode 100644 ghc/tests/ghci/ghci005.stdout diff --git a/ghc/tests/ghci/ghci005.script b/ghc/tests/ghci/ghci005.script new file mode 100644 index 0000000..f25481d --- /dev/null +++ b/ghc/tests/ghci/ghci005.script @@ -0,0 +1,13 @@ +:unset +s +t +-- tests for :def, :undef +let void m = m >> return "" +let echo s = void (putStrLn s) +:def echo echo +:echo hello, world! + +let echo s = return (":! echo " ++ map Char.toUpper s) +:echo hello, world! +:def echo echo +:undef echo +:def echo echo +:echo hello, world! diff --git a/ghc/tests/ghci/ghci005.stdout b/ghc/tests/ghci/ghci005.stdout new file mode 100644 index 0000000..7514da8 --- /dev/null +++ b/ghc/tests/ghci/ghci005.stdout @@ -0,0 +1,25 @@ + ___ ___ _ + / _ \ /\ /\/ __(_) + / /_\// /_/ / / | | GHC Interactive, version 4.11, For Haskell 98. +/ /_\\/ __ / /___| | http://www.haskell.org/ghc/ +\____/\/ /_/\____/|_| Type :? for help. + +Loading package std ... linking ... done. +Prelude> :unset +s +t +Prelude> -- tests for :def, :undef +Prelude> let void m = m >> return "" +Prelude> let echo s = void (putStrLn s) +Prelude> :def echo echo +Prelude> :echo hello, world! +Prelude> +Prelude> let echo s = return (":! echo " ++ map Char.toUpper s) +hello, world! +Prelude> :echo hello, world! +Prelude> :def echo echo +ghc: command `echo' is already defined +Prelude> :undef echo +Prelude> :def echo echo +Prelude> :echo hello, world! +HELLO, WORLD! +Prelude> Leaving GHCi. +hello, world! -- 1.7.10.4