Commit 0a9e58bd authored by pfdietz's avatar pfdietz

Added forgotten tests for MAKUNBOUND

parent 81a4b338
......@@ -9,9 +9,10 @@
(load "gensym.lsp")
(load "gentemp.lsp")
(load "symbol-function.lsp")
(load "boundp.lsp")
(load "symbol-name.lsp")
(load "boundp.lsp")
(load "special-operator-p.lsp")
(load "makunbound.lsp")
(load "set.lsp")
(load "remprop.lsp")
(load "get.lsp")
......
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Tue Jul 13 07:55:05 2004
;;;; Contains: Add tests for MAKUNBOUND
(in-package :cl-test)
(deftest makunbound.1
(let ((sym (gensym)))
(values
(boundp sym)
(equalt (multiple-value-list (makunbound sym)) (list sym))
(boundp sym)
(setf (symbol-value sym) nil)
(notnot (boundp sym))
(equalt (multiple-value-list (makunbound sym)) (list sym))
(boundp sym)))
nil t nil nil t t nil)
(deftest makunbound.2
(let ((sym (gensym)))
(values
(boundp sym)
(setf (symbol-value sym) :foo)
(equalt (multiple-value-list (makunbound sym)) (list sym))
(boundp sym)
(handler-case (symbol-value sym)
(unbound-variable () :good))))
nil :foo t nil :good)
;;; Error cases
(deftest makunbound.error.1
(signals-error (makunbound) program-error)
t)
(deftest makunbound.error.2
(signals-error (makunbound (gensym) nil) program-error)
t)
(deftest makunbound.error.3
(loop for x in *mini-universe*
for form = `(signals-error (makunbound ',x) type-error)
unless (or (symbolp x) (eval form))
collect x)
nil)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment