Permalink
Browse files

Modified a test.

  • Loading branch information...
1 parent 3a9b376 commit e9c0d0c79429a81ddbda33dae5d1d8204d0b9c6c @Raynes Raynes committed Jul 28, 2010
Showing with 7 additions and 6 deletions.
  1. +7 −6 test/clj_sandbox/core_test.clj
@@ -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))"))))

0 comments on commit e9c0d0c

Please sign in to comment.