summaryrefslogtreecommitdiffstats
path: root/tests/017/ffi-misc.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-01-28 07:42:10 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-01-28 07:42:10 -0800
commitcc413849fc0b92fee3c33ffd16378ca6ffa1070d (patch)
tree1daeb8be5180accdf97323595f2bbb3b72674f5d /tests/017/ffi-misc.tl
parentd18bf6605613cc0eb8038d1e42f5faac37510a1a (diff)
downloadtxr-cc413849fc0b92fee3c33ffd16378ca6ffa1070d.tar.gz
txr-cc413849fc0b92fee3c33ffd16378ca6ffa1070d.tar.bz2
txr-cc413849fc0b92fee3c33ffd16378ca6ffa1070d.zip
New function: copy-cptr.
* eval.c (eval_init): copy-cptr intrinsic registered. * lib.c (copy_cptr): New function. (copy): Use copy_cptr for CPTR objects. * lib.h (copy_cptr): Declared. * tests/017/ffi-misc.tl: New test cases. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests/017/ffi-misc.tl')
-rw-r--r--tests/017/ffi-misc.tl5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/017/ffi-misc.tl b/tests/017/ffi-misc.tl
index 377d7572..7053f78e 100644
--- a/tests/017/ffi-misc.tl
+++ b/tests/017/ffi-misc.tl
@@ -83,3 +83,8 @@
(each-match ((a b c) (rperm '(fals true) 3))
(let ((s (new abc a a b b c c)))
(test (ffi-get (ffi-put s (ffi abc)) (ffi-abc)) s)))
+
+(mstest
+ (copy-cptr (cptr-int 3)) "#<cptr: 3>"
+ (copy (cptr-int 3)) "#<cptr: 3>"
+ (copy-cptr 3) :error)