source: trunk/source/tests/ansi-tests/symbol-function.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: 993 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jul 13 07:38:43 2004
4;;;; Contains: Tests of SYMBOL-FUNCTION
5
6(in-package :cl-test)
7
8(deftest symbol-function.1
9  (let ((sym (gensym))
10        (f #'(lambda () (values 1 2 3))))
11    (values
12     (eqt (setf (symbol-function sym) f) f)
13     (multiple-value-list (eval (list sym)))))
14  t (1 2 3))
15
16;;; Error cases
17
18(deftest symbol-function.error.1
19  (signals-error (symbol-function) program-error)
20  t)
21
22(deftest symbol-function.error.2
23  (signals-error (symbol-function 'cons nil) program-error)
24  t)
25
26(deftest symbol-function.error.3
27  (check-type-error #'symbol-function #'symbolp)
28  nil)
29
30(deftest symbol-function.error.4
31  (check-type-error #'(lambda (x) (setf (symbol-function x) #'identity))
32                    #'symbolp)
33  nil)
34
35(deftest symbol-function.error.5
36  (let ((sym (gensym)))
37    (handler-case (progn (symbol-function sym) nil)
38                  (undefined-function
39                   (c)
40                   (assert (eq (cell-error-name c) sym))
41                   :good)))
42  :good)
43
44
45
Note: See TracBrowser for help on using the repository browser.