Fix tests: add :tangle to mock org blocks, fix parse-message

This commit is contained in:
2026-04-23 13:44:03 -04:00
parent dfe318425f
commit 442f177177
6 changed files with 90 additions and 82 deletions

View File

@@ -8,10 +8,12 @@
(test test-framing
"Verify that messages are correctly prefixed with a 6-character hex length."
(let ((msg "(:type :EVENT :payload (:action :handshake))"))
;; As the Analyst, I expect a function 'frame-message' to exist
(is (string= "00002c(:type :EVENT :payload (:action :handshake))"
(opencortex:frame-message msg)))))
(let* ((msg '(:type :EVENT :payload (:action :handshake)))
(framed (opencortex:frame-message msg))
(len-str (subseq framed 0 6))
(payload (subseq framed 6)))
(is (string= "00002C" (string-upcase len-str)))
(is (equalp msg (read-from-string payload)))))
(test test-parse-message
"Verify that incoming framed strings are parsed into Lisp plists."