Test requires from native code
This commit is contained in:
parent
bd478590fa
commit
1e7c90c44e
@ -689,8 +689,17 @@
|
||||
|
||||
|
||||
(defn test-require []
|
||||
"NATIVE: test requiring macros from python code"
|
||||
(try
|
||||
(assert (= "this won't happen" (qplah 1 2 3 4)))
|
||||
(catch [NameError]))
|
||||
(require tests.resources.tlib)
|
||||
(assert (= [1 2 3] (qplah 1 2 3))))
|
||||
|
||||
|
||||
(defn test-require-native []
|
||||
"NATIVE: test requiring macros from native code"
|
||||
(require tests.native_tests.native_macros)
|
||||
(setv x [])
|
||||
(rev (.append x 1) (.append x 2) (.append x 3))
|
||||
(assert (= x [3 2 1])))
|
||||
|
@ -1,10 +1,10 @@
|
||||
(defmacro rev [&rest body]
|
||||
"Execute the `body` statements in reverse"
|
||||
(quasiquote (do (unquote-splice (list (reversed body))))))
|
||||
|
||||
|
||||
(defn test-rev-macro []
|
||||
"NATIVE: test stararged native macros"
|
||||
(defmacro rev [&rest body]
|
||||
"Execute the `body` statements in reverse"
|
||||
(quasiquote (do (unquote-splice (list (reversed body)))))))
|
||||
|
||||
(setv x [])
|
||||
(rev (.append x 1) (.append x 2) (.append x 3))
|
||||
(assert (= x [3 2 1])))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user