47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
;; Function To Be Tested: clrhash
|
|
;;
|
|
;; Source: CommonLisp by Steele Section: 16.1: Hash Table
|
|
;; Functions Page: 285
|
|
;;
|
|
;; Created By: John Park
|
|
;;
|
|
;; Creation Date: May 13, 1986
|
|
;;
|
|
;; Last Update:
|
|
;;
|
|
;; Filed As: {eris}<lispcore>cml>test>16-1-clrhash.test
|
|
;;
|
|
;;
|
|
;; Syntax: clrhash hash-table
|
|
;;
|
|
;; Function Description: clrhash removes all the entries from hash-table and returns the hash table itself.
|
|
;;
|
|
;; Argument(s): hash-table
|
|
;;
|
|
;; Returns: hash table
|
|
;;
|
|
;; Constraints/Limitations: None
|
|
|
|
(do-test-group (set-hash-table
|
|
:before (progn
|
|
(setf hash-table3 (make-hash-table :size 5
|
|
:rehash-size 5))
|
|
(setf (gethash 'car hash-table3) 'vw)
|
|
(setf (gethash 'year hash-table3) 1970)
|
|
(setf (gethash 'mileage hash-table3) 99999)
|
|
(setf (gethash 'option hash-table3) 'sunroof)
|
|
(setf (gethash 'owner hash-table3) 'smith)))
|
|
|
|
(do-test clrhash-test
|
|
(and (eq (gethash 'car hash-table3) 'vw)
|
|
(eq (gethash 'year hash-table3) 1970)
|
|
(eql (gethash 'mileage hash-table3) 99999)
|
|
(eq (gethash 'option hash-table3) 'sunroof)
|
|
(eq (gethash 'owner hash-table3) 'smith)
|
|
(typep (clrhash hash-table3) 'hash-table)
|
|
(eq (gethash 'car hash-table3) nil)
|
|
(eq (gethash 'year hash-table3) nil)
|
|
(eq (gethash 'mileage hash-table3) nil)
|
|
(eq (gethash 'option hash-table3) nil)
|
|
(eq (gethash 'owner hash-table3) nil))))
|
|
STOP |