[ADD]Test : unit test case macro
This commit is contained in:
parent
d1071b8e61
commit
ce816fc284
@ -27,3 +27,10 @@
|
|||||||
(defmacro odo-assert-raises [Error body]
|
(defmacro odo-assert-raises [Error body]
|
||||||
"Macro to test Error with self.assertRaises and do block"
|
"Macro to test Error with self.assertRaises and do block"
|
||||||
`(with [err (.assertRaises self ~Error)] ~body))
|
`(with [err (.assertRaises self ~Error)] ~body))
|
||||||
|
|
||||||
|
(defmacro o-test [name body]
|
||||||
|
"Macro for unit test case"
|
||||||
|
(setv fn-name (% "test-%s" (str name))
|
||||||
|
humanized-name (.replace (str name) "-" " ")
|
||||||
|
descr (bytes (% "Test %s" humanized-name)))
|
||||||
|
`(defn ~(HySymbol fn-name) [self] ~descr ~body))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user