1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-22 03:07:41 +00:00

Fix ffi/defbind for non-lazy bindings.

Add testing to bind to symbols in current binary.
This commit is contained in:
Calvin Rose
2022-06-18 10:14:42 -05:00
parent a1aab4008f
commit d803561582
2 changed files with 12 additions and 1 deletions

View File

@@ -28,5 +28,16 @@
(assert (= (thunk) 1) "delay 3")
(assert (= counter 1) "delay 4")
# FFI check
(compwhen (dyn 'ffi/native)
(ffi/context))
(compwhen (dyn 'ffi/native)
(ffi/defbind memcpy :ptr [dest :ptr src :ptr n :size]))
(compwhen (dyn 'ffi/native)
(def buffer1 @"aaaa")
(def buffer2 @"bbbb")
(memcpy buffer1 buffer2 4)
(assert (= (string buffer1) "bbbb") "ffi 1 - memcpy"))
(end-suite)