Skip to content

Commit

Permalink
tests for #299
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
stuarthalloway committed Apr 21, 2010
1 parent 95faca8 commit 26c18ac
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/clojure/test_clojure.clj
Expand Up @@ -50,6 +50,7 @@
:clojure-zip
:protocols
:genclass
:main
])

(def test-namespaces
Expand Down
24 changes: 24 additions & 0 deletions 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)")))))))

0 comments on commit 26c18ac

Please sign in to comment.