hy/tests/native_tests/with_decorator.hy
Ryan Gonzalez c7e4d4cd6e Add tests
2014-11-14 14:21:16 -06:00

22 lines
332 B
Hy

(defn foodec [func]
(lambda [] (+ 1 1)))
(with-decorator foodec
(defn tfunction []
(* 2 2)))
(defn bardec [cls]
(setv cls.my_attr 123))
(with-decorator bardec
(defclass cls []
[[my_attr 456]]))
(defn test-decorators []
"NATIVE: test decorators."
(assert (= (tfunction) 2))
(assert (= cls.my_attr 123)))