source: trunk/source/tests/ansi-tests/clrhash.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Fri Nov 28 09:33:40 2003
4;;;; Contains: Tests of CLRHASH
5
6(in-package :cl-test)
7
8(deftest clrhash.1
9  (let ((table (make-hash-table)))
10    (setf (gethash 'a table) 'b)
11    (values
12     (hash-table-count table)
13     (equalt (multiple-value-list (clrhash table))
14             (list table))
15     (hash-table-count table)))
16  1 t 0)
17
18(deftest clrhash.2
19  (let ((table (make-hash-table :test 'eq)))
20    (setf (gethash 'a table) 'b)
21    (values
22     (hash-table-count table)
23     (equalt (multiple-value-list (clrhash table))
24             (list table))
25     (hash-table-count table)))
26  1 t 0)
27
28(deftest clrhash.3
29  (let ((table (make-hash-table :test 'equal)))
30    (setf (gethash 'a table) 'b)
31    (values
32     (hash-table-count table)
33     (equalt (multiple-value-list (clrhash table))
34             (list table))
35     (hash-table-count table)))
36  1 t 0)
37
38(deftest clrhash.4
39  (let ((table (make-hash-table :test 'equalp)))
40    (setf (gethash 'a table) 'b)
41    (values
42     (hash-table-count table)
43     (equalt (multiple-value-list (clrhash table))
44             (list table))
45     (hash-table-count table)))
46  1 t 0)
47
48(deftest clrhash.5
49  (let ((table (make-hash-table :test 'eql)))
50    (setf (gethash 'a table) 'b)
51    (values
52     (hash-table-count table)
53     (equalt (multiple-value-list (clrhash table))
54             (list table))
55     (hash-table-count table)))
56  1 t 0)
57
58;;;
59
60(deftest clrhash.error.1
61  (signals-error (clrhash) program-error)
62  t)
63
64(deftest clrhash.error.2
65  (signals-error (clrhash (make-hash-table) nil)
66                 program-error)
67  t)
68
69
Note: See TracBrowser for help on using the repository browser.