1.0.13.25: reinstante *PERIODIC-POLLING-FUNCTION*
[sbcl.git] / tests / hash.pure.lisp
bloba7d195ee7bd402d7974ff21034389ab230dbacce
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; While most of SBCL is derived from the CMU CL system, the test
5 ;;;; files (like this one) were written from scratch after the fork
6 ;;;; from CMU CL.
7 ;;;;
8 ;;;; This software is in the public domain and is provided with
9 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
10 ;;;; more information.
12 (in-package :cl-user)
14 ;;; +MAGIC-HASH-VECTOR-VALUE+ is used to mark empty entries in the slot
15 ;;; HASH-VECTOR of hash tables. It must be a value outside of the range
16 ;;; of SXHASH. The range of SXHASH is the non-negative fixnums.
17 (assert (not (typep sb-impl::+magic-hash-vector-value+
18 '(and fixnum unsigned-byte))))
20 ;;; The return value of SXHASH on non-string/bitvector arrays should not
21 ;;; change when the contents of the array change.
22 (let* ((a (make-array '(1) :initial-element 1))
23 (sxhash (sxhash a))
24 (hash (make-hash-table :test 'equal)))
25 (setf (gethash a hash) t)
26 (setf (aref a 0) 0)
27 (assert (= sxhash (sxhash a)))
28 ;; Need to make another access to the hash to disable the last-seen-element
29 ;; cache.
30 (setf (gethash 'y hash) t)
31 (assert (gethash a hash)))