hash-table-test.lsp 1.16 KB
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Fri Nov 28 05:56:22 2003
;;;; Contains: Tests for HASH-TABLE-TEST

6

7 8 9 10 11 12 13

(deftest hash-table-test.1
  (hash-table-test (make-hash-table))
  eql)

(deftest hash-table-test.2
  (loop for test in '(eq eql equal equalp)
sds's avatar
sds committed
14 15
        unless (eq (hash-table-test (make-hash-table :test test)) test)
        collect test)
16 17 18 19
  nil)

(deftest hash-table-test.3
  (loop for test in '(eq eql equal equalp)
sds's avatar
sds committed
20 21 22 23
        unless (eq (hash-table-test (make-hash-table
                                     :test (symbol-function test)))
                   test)
        collect test)
24 25 26 27
  nil)

(deftest hash-table-test.4
  (loop for test in '(eq eql equal equalp)
sds's avatar
sds committed
28 29 30 31
        unless (eq (hash-table-test (make-hash-table
                                     :test (eval `(function ,test))))
                   test)
        collect test)
32 33 34 35 36
  nil)

;;; Error cases

(deftest hash-table-test.error.1
37 38
  (signals-error (hash-table-test) program-error)
  t)
39 40

(deftest hash-table-test.error.2
41 42
  (signals-error (hash-table-test (make-hash-table) nil)  program-error)
  t)
43 44

(deftest hash-table-test.error.3
45
  (check-type-error #'hash-table-test #'hash-table-p)
46
  nil)