Skip to content

Commit

Permalink
Modified a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Jul 28, 2010
1 parent 3a9b376 commit e9c0d0c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/clj_sandbox/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@


(deftest initial-test
(let [newdefn '(defn + [x y] (- x y))
sc (stringify-sandbox (new-sandbox-compiler
:tester (extend-tester secure-tester (whitelist (function-matcher 'defn 'meta)))
:initial ['(ns-unmap *ns* '+)
newdefn]))]
(is (= 42 ((sc "(+ 44 2)"))))))
(let [defn2 '(defmacro defn [name & body] `(def ~name (fn ~name ~@body)))
sc (stringify-sandbox (new-sandbox-compiler
:tester (extend-tester secure-tester (whitelist (function-matcher 'def)))
:timer 10000
:remember-state 5
:initial [defn2]))]
(is (= '(def blah (fn* ([] 1))) ((sc "(macroexpand '(defn blah [] 1))"))))))

(deftest stringwriter-test
(is (= "3\n" (run-in-stringwriter-compiler "(with-out-str (println 3))"))))
Expand Down

0 comments on commit e9c0d0c

Please sign in to comment.