1
0
mirror of synced 2026-05-03 14:49:45 +00:00
Files
Interlisp.medley/internal/test/LANGUAGE/AUTO/16-1-REMHASH.TEST

49 lines
1.4 KiB
Plaintext

;; Function To Be Tested: remhash
;;
;; Source: CommonLisp by Steele Section: 16.1: Hash Table
;; Functions Page: 284
;;
;; Created By: John Park
;;
;; Creation Date: May 13, 1986
;;
;; Last Update:
;;
;; Filed As: {eris}<lispcore>cml>test>16-1-remhash.test
;;
;;
;; Syntax: remhash key hash-table
;;
;; Function Description: remhash removes any entry for key in hash-table. This is true if there was an entry or false if there was not.
;;
;; Argument(s): key and hashtable
;;
;; Returns: T or NIL
;;
;; Constraints/Limitations: None
(do-test-group (set-hash-table
:before (progn
(setf hash-table2 (make-hash-table :size 7))
(setf (gethash 'name hash-table2) 'joshua)
(setf (gethash 'age hash-table2) 24)
(setf (gethash 'number hash-table2) 1234)
(setf (gethash 'weight hash-table2) 150)
(setf (gethash 'job hash-table2) 'writer)))
(do-test gethash-test
(and (eq (remhash 'name hash-table2) T)
(eq (remhash 'name hash-table2) NIL)
(eq (remhash 'age hash-table2) T)
(eq (remhash 'age hash-table2) NIL )
(eq (remhash 'number hash-table2) T)
(eq (remhash 'number hash-table2) NIL)
(eq (remhash 'weight hash-table2) T)
(eq (remhash 'weight hash-table2) NIL)
(eq (remhash 'job hash-table2) T)
(eq (remhash 'job hash-table2) NIL)
(eq (remhash 'address hash-table2) NIL))))
STOP