diff --git a/test/clj/coffi/mem_test.clj b/test/clj/coffi/mem_test.clj index 3f531ad..3f72f89 100644 --- a/test/clj/coffi/mem_test.clj +++ b/test/clj/coffi/mem_test.clj @@ -67,4 +67,12 @@ (TestType. 5 10 15) identity (TestType. 5 10 15) (fn [s] {:a 5 :b 10 :c 15}))) +(t/deftest can-serialize-struct-type + (t/is + (instance? MemorySegment (mem/serialize (TestType. 5 10 15) ::TestType)))) + +(t/deftest can-deserialize-struct-type + (t/is + (= {:a 5 :b 10 :c 15} + (mem/deserialize (mem/serialize (TestType. 5 10 15) ::TestType) ::TestType))))