diff --git a/ansi-tests/aux.lsp b/ansi-tests/aux.lsp index 83a2b338ede1384ab83d7e93dbe29bb88c6222a8..266b764641985ca4703d77bbba48cd971a57a5fa 100644 --- a/ansi-tests/aux.lsp +++ b/ansi-tests/aux.lsp @@ -82,6 +82,7 @@ If an error does occur, return a symbol classify the error, or allow the condition to go uncaught if it cannot be classified." `(locally (declare (optimize (safety 3))) (handler-case ,form + (undefined-function () 'undefined-function) (program-error () 'program-error) (type-error () 'type-error)))) diff --git a/ansi-tests/funcall.lsp b/ansi-tests/funcall.lsp new file mode 100644 index 0000000000000000000000000000000000000000..afab954bc8f48172be5dddbba130e95741a2e2db --- /dev/null +++ b/ansi-tests/funcall.lsp @@ -0,0 +1,57 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Wed Oct 9 21:45:07 2002 +;;;; Contains: Tests of FUNCALL + +(in-package :cl-test) + +(deftest funcall.1 + (let ((fn #'cons)) + (funcall fn 'a 'b)) + (a . b)) + +(deftest funcall.2 + (funcall (symbol-function 'cons) 'a 'b) + (a . b)) + +(deftest funcall.3 + (let ((fn 'cons)) + (funcall fn 'a 'b)) + (a . b)) + +(deftest funcall.4 + (funcall 'cons 'a 'b) + (a . b)) + +(deftest funcall.5 + (let ((fn #'+)) + (funcall fn 1 2 3 4)) + 10) + +(deftest funcall.6 + (funcall #'(lambda (x y) (cons x y)) 'a 'b) + (a . b)) + +(deftest funcall.7 + (flet ((cons (x y) (list y x))) + (values (funcall 'cons 1 2) + (funcall #'cons 1 2))) + (1 . 2) + (2 1)) + +;;; FUNCALL should throw an UNDEFINED-FUNCTION condition when +;;; called on a symbol with a global definition as a special +;;; operator +(deftest funcall.8 + (classify-error (funcall 'quote 1)) + undefined-function) + +(deftest funcall.9 + (classify-error (funcall 'progn 1)) + undefined-function) + +;;; FUNCALL should throw an UNDEFINED-FUNCTION condition when +;;; called on a symbol with a global definition as a macro +(deftest funcall.10 + (classify-error (funcall 'defconstant '(defconstant x 10))) + undefined-function) diff --git a/ansi-tests/gclload2.lsp b/ansi-tests/gclload2.lsp index 544187b7bd7b3aeec1190fa32b1afa444c6ed321..1621d2b0969f0f7c654ffffbf0dd61ee09d7ab07 100644 --- a/ansi-tests/gclload2.lsp +++ b/ansi-tests/gclload2.lsp @@ -11,8 +11,10 @@ (load "fboundp.lsp") (load "flet.lsp") (load "fmakunbound.lsp") +(load "funcall.lsp") (load "function.lsp") (load "functionp.lsp") +(load "labels.lsp") (load "lambda-list-keywords.lsp") (load "macrolet.lsp")