hash-table-rehash-threshold.lsp 1.15 KB
Newer Older
1 2 3 4 5 6 7 8 9
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Fri Nov 28 05:52:52 2003
;;;; Contains: Tests of HASH-TABLE-REHASH-THRESHOLD

(in-package :cl-test)

(deftest hash-table-rehash-threshold.1
  (typep* (hash-table-rehash-threshold (make-hash-table))
sds's avatar
sds committed
10
          '(real 0 1))
11 12 13 14
  t)

(deftest hash-table-rehash-threshold.2
  (loop for test in '(eq eql equal equalp)
sds's avatar
sds committed
15 16 17
        unless (typep* (hash-table-rehash-threshold (make-hash-table :test test))
                       '(real 0 1))
        collect test)
18 19 20 21
  nil)

(deftest hash-table-rehash-threshold.3
  (loop for test in '(eq eql equal equalp)
sds's avatar
sds committed
22 23 24 25
        for fn = (symbol-function test)
        unless (typep* (hash-table-rehash-threshold (make-hash-table :test fn))
                       '(real 0 1))
        collect test)
26 27 28
  nil)

(deftest hash-table-rehash-threshold.error.1
29 30
  (signals-error (hash-table-rehash-threshold) program-error)
  t)
31 32

(deftest hash-table-rehash-threshold.error.2
33
  (signals-error (hash-table-rehash-threshold (make-hash-table) nil)
sds's avatar
sds committed
34
                 program-error)
35
  t)
36 37

(deftest hash-table-rehash-threshold.error.3
38
  (check-type-error #'hash-table-rehash-threshold #'hash-table-p)
39
  nil)