diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2010-04-20 17:05:29 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-04-20 22:12:21 -0400 |
commit | 26c18ac329a27bf2880c1394d20245a9e9f23847 (patch) | |
tree | 7a657a9c434d1cf798899d2c6da7cc9a4beb416b | |
parent | 95faca8a942b0b95d9b8b896238802849d547a46 (diff) |
tests for #299
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r-- | test/clojure/test_clojure.clj | 1 | ||||
-rw-r--r-- | test/clojure/test_clojure/main.clj | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/clojure/test_clojure.clj b/test/clojure/test_clojure.clj index 346aa406..d29f7bb0 100644 --- a/test/clojure/test_clojure.clj +++ b/test/clojure/test_clojure.clj @@ -50,6 +50,7 @@ :clojure-zip :protocols :genclass + :main ]) (def test-namespaces diff --git a/test/clojure/test_clojure/main.clj b/test/clojure/test_clojure/main.clj new file mode 100644 index 00000000..3a552b72 --- /dev/null +++ b/test/clojure/test_clojure/main.clj @@ -0,0 +1,24 @@ +; Copyright (c) Rich Hickey. All rights reserved. +; The use and distribution terms for this software are covered by the +; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) +; which can be found in the file epl-v10.html at the root of this distribution. +; By using this software in any fashion, you are agreeing to be bound by +; the terms of this license. +; You must not remove this notice, or any other, from this software. + +; Author: Stuart Halloway + + +(ns clojure.test-clojure.main + (:use clojure.test)) + +(deftest eval-opt + (testing "evals and prints forms" + (is (= "2\n4\n" (with-out-str (#'clojure.main/eval-opt "(+ 1 1) (+ 2 2)"))))) + + (testing "skips printing nils" + (is (= ":a\n:c\n" (with-out-str (#'clojure.main/eval-opt ":a nil :c"))))) + + (testing "does not block access to *in* (#299)" + (with-in-str "(+ 1 1)" + (is (= "(+ 1 1)\n" (with-out-str (#'clojure.main/eval-opt "(read)"))))))) |