Now handles things which throw exceptions

This commit is contained in:
Simon Brooke 2014-04-02 20:51:11 +01:00
parent 06f16d561f
commit f65185b963

View file

@ -1,11 +1,9 @@
(ns testgen.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(defn write-test [fnname arg]
(list 'is (list '= (list fnname arg) (eval (list fnname arg)))))
(try
(list 'is (list '= (list fnname arg) (eval (list fnname arg))))
(catch Exception e (list 'is (list 'thrown? (.getClass e) (list fnname arg))))))
(defn testgen [fndef] nil)