master: Test the previous-relative encoding of xref form-number

crhodes via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  8a15ebb1367407fe89cf51cc1b7da0456bb49f58 (commit)
      from  7a6a70dbb834a3428627548ed2ff1353aa85cf06 (commit)

- Log -----------------------------------------------------------------
commit 8a15ebb1367407fe89cf51cc1b7da0456bb49f58
Author: Christophe Rhodes <[email protected]>
Date:   Thu Apr 30 17:01:11 2026 +0100

    Test the previous-relative encoding of xref form-number
    
    The simplest of smoke tests only
---
 tests/xref.pure.lisp | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/xref.pure.lisp b/tests/xref.pure.lisp
new file mode 100644
index 000000000..15cea1a37
--- /dev/null
+++ b/tests/xref.pure.lisp
@@ -0,0 +1,24 @@
+;;;; consistency tests with no side-effects of the xref en/decoder
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; While most of SBCL is derived from the CMU CL system, the test
+;;;; files (like this one) were written from scratch after the fork
+;;;; from CMU CL.
+;;;;
+;;;; This software is in the public domain and is provided with
+;;;; absolutely no warranty. See the COPYING and CREDITS files for
+;;;; more information.
+
+(with-test (:name (:xref :smoke :form-number))
+  (let* ((data '(:sets ((x . 10) (x . 11) (y . 12))))
+         (packed (sb-c::pack-xref-data data))
+         (expected '((:sets x 10) (:sets x 11) (:sets y 12)))
+         (map-result (make-hash-table :test 'equal)))
+    (flet ((mapper (kind name form-number)
+             (setf (gethash (list kind name form-number) map-result) t)))
+      (sb-c:map-packed-xref-data #'mapper packed)
+      (dolist (e expected)
+        (assert (gethash e map-result)))
+      (assert (= (hash-table-count map-result) 3)))))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.