source: trunk/source/tests/ansi-tests/class-name.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 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:  Sun Jun 15 12:05:47 2003
4;;;; Contains: Tests of CLASS-NAME
5
6(in-package :cl-test)
7
8;;; This is mostly tested elsewhere.
9
10(deftest class-name.1
11  (class-name (find-class 'symbol))
12  symbol)
13
14(defclass class-name-class-01 () (a b c))
15
16(report-and-ignore-errors
17 (eval '(defmethod class-name ((x class-name-class-01)) 'silly)))
18
19(deftest class-name.2
20  (class-name (make-instance 'class-name-class-01))
21  silly)
22
23;; Tests of (setf class-name)
24
25(deftest setf-class-name.1
26  (typep* #'(setf class-name) 'standard-generic-function)
27  t)
28
29(deftest setf-class-name.2
30  (let ((sym (gensym))
31        (newsym (gensym)))
32    (eval `(defclass ,sym () (a b c)))
33    (let ((class (find-class sym)))
34      (values
35       (eqlt (class-name class) sym)
36       (equalt
37        (multiple-value-list (setf (class-name (find-class sym)) newsym))
38        (list newsym))
39       (eqlt newsym (class-name class)))))
40  t t t)
41     
42
43;;; Error tests
44
45(deftest class-name.error.1
46  (signals-error (class-name) program-error)
47  t)
48
49(deftest class-name.error.2
50  (signals-error (class-name (find-class 'symbol) nil)
51                 program-error)
52  t)
Note: See TracBrowser for help on using the repository browser.