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

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

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

File size: 1.1 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jul 13 07:55:05 2004
4;;;; Contains: Add tests for MAKUNBOUND
5
6(in-package :cl-test)
7
8(deftest makunbound.1
9  (let ((sym (gensym)))
10    (values
11     (boundp sym)
12     (equalt (multiple-value-list (makunbound sym)) (list sym))
13     (boundp sym)
14     (setf (symbol-value sym) nil)
15     (notnot (boundp sym))
16     (equalt (multiple-value-list (makunbound sym)) (list sym))
17     (boundp sym)))
18  nil t nil nil t t nil)
19
20(deftest makunbound.2
21  (let ((sym (gensym)))
22    (values
23     (boundp sym)
24     (setf (symbol-value sym) :foo)
25     (equalt (multiple-value-list (makunbound sym)) (list sym))
26     (boundp sym)
27     (handler-case (symbol-value sym)
28                   (unbound-variable (c)
29                     (if (eq (cell-error-name c) sym) :good
30                       (list :bad sym (cell-error-name c)))))))
31  nil :foo t nil :good)
32
33;;; Error cases
34
35(deftest makunbound.error.1
36  (signals-error (makunbound) program-error)
37  t)
38
39(deftest makunbound.error.2
40  (signals-error (makunbound (gensym) nil) program-error)
41  t)
42
43(deftest makunbound.error.3
44  (check-type-error #'makunbound #'symbolp)
45  nil)
Note: See TracBrowser for help on using the repository browser.