[8991] | 1 | ;-*- Mode: Lisp -*- |
---|
| 2 | ;;;; Author: Paul Dietz |
---|
| 3 | ;;;; Created: Sun Jan 26 21:36:33 2003 |
---|
| 4 | ;;;; Contains: Tests for MAKE-HASH-TABLE |
---|
| 5 | |
---|
| 6 | (in-package :cl-test) |
---|
| 7 | |
---|
| 8 | ;; (eval-when (:load-toplevel :compile-toplevel :execute) |
---|
| 9 | ;; (compile-and-load "hash-table-aux.lsp")) |
---|
| 10 | |
---|
| 11 | (deftest make-hash-table.1 |
---|
| 12 | (let ((ht (make-hash-table))) |
---|
| 13 | (values |
---|
| 14 | (notnot (typep ht 'hash-table)) |
---|
| 15 | (notnot (hash-table-p ht)) |
---|
| 16 | (hash-table-count ht))) |
---|
| 17 | t t 0) |
---|
| 18 | |
---|
| 19 | (deftest make-hash-table.2 |
---|
| 20 | (let ((ht (make-hash-table :size 0))) |
---|
| 21 | (values |
---|
| 22 | (notnot (typep ht 'hash-table)) |
---|
| 23 | (notnot (hash-table-p ht)) |
---|
| 24 | (hash-table-count ht))) |
---|
| 25 | t t 0) |
---|
| 26 | |
---|
| 27 | (deftest make-hash-table.3 |
---|
| 28 | (let ((ht (make-hash-table :size 100))) |
---|
| 29 | (values |
---|
| 30 | (notnot (typep ht 'hash-table)) |
---|
| 31 | (notnot (hash-table-p ht)) |
---|
| 32 | (hash-table-count ht))) |
---|
| 33 | t t 0) |
---|
| 34 | |
---|
| 35 | (deftest make-hash-table.4 |
---|
| 36 | (let ((ht (make-hash-table :test #'eq))) |
---|
| 37 | (values |
---|
| 38 | (notnot (typep ht 'hash-table)) |
---|
| 39 | (notnot (hash-table-p ht)) |
---|
| 40 | (hash-table-count ht))) |
---|
| 41 | t t 0) |
---|
| 42 | |
---|
| 43 | (deftest make-hash-table.5 |
---|
| 44 | (let ((ht (make-hash-table :test 'eq))) |
---|
| 45 | (values |
---|
| 46 | (notnot (typep ht 'hash-table)) |
---|
| 47 | (notnot (hash-table-p ht)) |
---|
| 48 | (hash-table-count ht))) |
---|
| 49 | t t 0) |
---|
| 50 | |
---|
| 51 | (deftest make-hash-table.6 |
---|
| 52 | (let ((ht (make-hash-table :test #'eql))) |
---|
| 53 | (values |
---|
| 54 | (notnot (typep ht 'hash-table)) |
---|
| 55 | (notnot (hash-table-p ht)) |
---|
| 56 | (hash-table-count ht))) |
---|
| 57 | t t 0) |
---|
| 58 | |
---|
| 59 | (deftest make-hash-table.7 |
---|
| 60 | (let ((ht (make-hash-table :test 'eql))) |
---|
| 61 | (values |
---|
| 62 | (notnot (typep ht 'hash-table)) |
---|
| 63 | (notnot (hash-table-p ht)) |
---|
| 64 | (hash-table-count ht))) |
---|
| 65 | t t 0) |
---|
| 66 | |
---|
| 67 | (deftest make-hash-table.8 |
---|
| 68 | (let ((ht (make-hash-table :test #'equal))) |
---|
| 69 | (values |
---|
| 70 | (notnot (typep ht 'hash-table)) |
---|
| 71 | (notnot (hash-table-p ht)) |
---|
| 72 | (hash-table-count ht))) |
---|
| 73 | t t 0) |
---|
| 74 | |
---|
| 75 | (deftest make-hash-table.9 |
---|
| 76 | (let ((ht (make-hash-table :test 'equal))) |
---|
| 77 | (values |
---|
| 78 | (notnot (typep ht 'hash-table)) |
---|
| 79 | (notnot (hash-table-p ht)) |
---|
| 80 | (hash-table-count ht))) |
---|
| 81 | t t 0) |
---|
| 82 | |
---|
| 83 | (deftest make-hash-table.10 |
---|
| 84 | (let ((ht (make-hash-table :test #'equalp))) |
---|
| 85 | (values |
---|
| 86 | (notnot (typep ht 'hash-table)) |
---|
| 87 | (notnot (hash-table-p ht)) |
---|
| 88 | (hash-table-count ht))) |
---|
| 89 | t t 0) |
---|
| 90 | |
---|
| 91 | (deftest make-hash-table.11 |
---|
| 92 | (let ((ht (make-hash-table :test 'equalp))) |
---|
| 93 | (values |
---|
| 94 | (notnot (typep ht 'hash-table)) |
---|
| 95 | (notnot (hash-table-p ht)) |
---|
| 96 | (hash-table-count ht))) |
---|
| 97 | t t 0) |
---|
| 98 | |
---|
| 99 | (deftest make-hash-table.12 |
---|
| 100 | (let ((ht (make-hash-table :rehash-size 1))) |
---|
| 101 | (values |
---|
| 102 | (notnot (typep ht 'hash-table)) |
---|
| 103 | (notnot (hash-table-p ht)) |
---|
| 104 | (hash-table-count ht))) |
---|
| 105 | t t 0) |
---|
| 106 | |
---|
| 107 | (deftest make-hash-table.13 |
---|
| 108 | (let ((ht (make-hash-table :rehash-size 1000))) |
---|
| 109 | (values |
---|
| 110 | (notnot (typep ht 'hash-table)) |
---|
| 111 | (notnot (hash-table-p ht)) |
---|
| 112 | (hash-table-count ht))) |
---|
| 113 | t t 0) |
---|
| 114 | |
---|
| 115 | (deftest make-hash-table.14 |
---|
| 116 | (let ((ht (make-hash-table :rehash-size (+ 1.0f0 single-float-epsilon)))) |
---|
| 117 | (values |
---|
| 118 | (notnot (typep ht 'hash-table)) |
---|
| 119 | (notnot (hash-table-p ht)) |
---|
| 120 | (hash-table-count ht))) |
---|
| 121 | t t 0) |
---|
| 122 | |
---|
| 123 | (deftest make-hash-table.15 |
---|
| 124 | (let ((ht (make-hash-table :rehash-size 2.0))) |
---|
| 125 | (values |
---|
| 126 | (notnot (typep ht 'hash-table)) |
---|
| 127 | (notnot (hash-table-p ht)) |
---|
| 128 | (hash-table-count ht))) |
---|
| 129 | t t 0) |
---|
| 130 | |
---|
| 131 | (deftest make-hash-table.16 |
---|
| 132 | (let ((ht (make-hash-table :rehash-threshold 0))) |
---|
| 133 | (values |
---|
| 134 | (notnot (typep ht 'hash-table)) |
---|
| 135 | (notnot (hash-table-p ht)) |
---|
| 136 | (hash-table-count ht))) |
---|
| 137 | t t 0) |
---|
| 138 | |
---|
| 139 | (deftest make-hash-table.17 |
---|
| 140 | (let ((ht (make-hash-table :rehash-threshold 0.0s0))) |
---|
| 141 | (values |
---|
| 142 | (notnot (typep ht 'hash-table)) |
---|
| 143 | (notnot (hash-table-p ht)) |
---|
| 144 | (hash-table-count ht))) |
---|
| 145 | t t 0) |
---|
| 146 | |
---|
| 147 | (deftest make-hash-table.18 |
---|
| 148 | (let ((ht (make-hash-table :rehash-threshold 0.0f0))) |
---|
| 149 | (values |
---|
| 150 | (notnot (typep ht 'hash-table)) |
---|
| 151 | (notnot (hash-table-p ht)) |
---|
| 152 | (hash-table-count ht))) |
---|
| 153 | t t 0) |
---|
| 154 | |
---|
| 155 | (deftest make-hash-table.19 |
---|
| 156 | (let ((ht (make-hash-table :rehash-threshold 0.0d0))) |
---|
| 157 | (values |
---|
| 158 | (notnot (typep ht 'hash-table)) |
---|
| 159 | (notnot (hash-table-p ht)) |
---|
| 160 | (hash-table-count ht))) |
---|
| 161 | t t 0) |
---|
| 162 | |
---|
| 163 | (deftest make-hash-table.20 |
---|
| 164 | (let ((ht (make-hash-table :rehash-threshold 0.0l0))) |
---|
| 165 | (values |
---|
| 166 | (notnot (typep ht 'hash-table)) |
---|
| 167 | (notnot (hash-table-p ht)) |
---|
| 168 | (hash-table-count ht))) |
---|
| 169 | t t 0) |
---|
| 170 | |
---|
| 171 | (deftest make-hash-table.21 |
---|
| 172 | (let ((ht (make-hash-table :rehash-threshold 1/2))) |
---|
| 173 | (values |
---|
| 174 | (notnot (typep ht 'hash-table)) |
---|
| 175 | (notnot (hash-table-p ht)) |
---|
| 176 | (hash-table-count ht))) |
---|
| 177 | t t 0) |
---|
| 178 | |
---|
| 179 | (deftest make-hash-table.22 |
---|
| 180 | (let ((ht (make-hash-table :rehash-threshold 0.1s0))) |
---|
| 181 | (values |
---|
| 182 | (notnot (typep ht 'hash-table)) |
---|
| 183 | (notnot (hash-table-p ht)) |
---|
| 184 | (hash-table-count ht))) |
---|
| 185 | t t 0) |
---|
| 186 | |
---|
| 187 | (deftest make-hash-table.23 |
---|
| 188 | (let ((ht (make-hash-table :rehash-threshold 0.2f0))) |
---|
| 189 | (values |
---|
| 190 | (notnot (typep ht 'hash-table)) |
---|
| 191 | (notnot (hash-table-p ht)) |
---|
| 192 | (hash-table-count ht))) |
---|
| 193 | t t 0) |
---|
| 194 | |
---|
| 195 | (deftest make-hash-table.24 |
---|
| 196 | (let ((ht (make-hash-table :rehash-threshold 0.8d0))) |
---|
| 197 | (values |
---|
| 198 | (notnot (typep ht 'hash-table)) |
---|
| 199 | (notnot (hash-table-p ht)) |
---|
| 200 | (hash-table-count ht))) |
---|
| 201 | t t 0) |
---|
| 202 | |
---|
| 203 | (deftest make-hash-table.25 |
---|
| 204 | (let ((ht (make-hash-table :rehash-threshold 0.99f0))) |
---|
| 205 | (values |
---|
| 206 | (notnot (typep ht 'hash-table)) |
---|
| 207 | (notnot (hash-table-p ht)) |
---|
| 208 | (hash-table-count ht))) |
---|
| 209 | t t 0) |
---|
| 210 | |
---|
| 211 | (deftest make-hash-table.26 |
---|
| 212 | (let ((ht (make-hash-table :rehash-threshold least-positive-short-float))) |
---|
| 213 | (values |
---|
| 214 | (notnot (typep ht 'hash-table)) |
---|
| 215 | (notnot (hash-table-p ht)) |
---|
| 216 | (hash-table-count ht))) |
---|
| 217 | t t 0) |
---|
| 218 | |
---|
| 219 | (deftest make-hash-table.27 |
---|
| 220 | (let ((ht (make-hash-table :rehash-threshold least-positive-single-float))) |
---|
| 221 | (values |
---|
| 222 | (notnot (typep ht 'hash-table)) |
---|
| 223 | (notnot (hash-table-p ht)) |
---|
| 224 | (hash-table-count ht))) |
---|
| 225 | t t 0) |
---|
| 226 | |
---|
| 227 | (deftest make-hash-table.28 |
---|
| 228 | (let ((ht (make-hash-table :rehash-threshold least-positive-double-float))) |
---|
| 229 | (values |
---|
| 230 | (notnot (typep ht 'hash-table)) |
---|
| 231 | (notnot (hash-table-p ht)) |
---|
| 232 | (hash-table-count ht))) |
---|
| 233 | t t 0) |
---|
| 234 | |
---|
| 235 | (deftest make-hash-table.29 |
---|
| 236 | (let ((ht (make-hash-table :rehash-threshold least-positive-long-float))) |
---|
| 237 | (values |
---|
| 238 | (notnot (typep ht 'hash-table)) |
---|
| 239 | (notnot (hash-table-p ht)) |
---|
| 240 | (hash-table-count ht))) |
---|
| 241 | t t 0) |
---|
| 242 | |
---|
| 243 | |
---|
| 244 | |
---|
| 245 | |
---|
| 246 | |
---|
| 247 | |
---|
| 248 | |
---|
| 249 | |
---|
| 250 | |
---|
| 251 | |
---|
| 252 | |
---|
| 253 | |
---|
| 254 | |
---|
| 255 | |
---|
| 256 | |
---|
| 257 | |
---|