Skip to content
Snippets Groups Projects
Commit 79456dac authored by pfdietz's avatar pfdietz
Browse files

Added tests for FUNCALL, loaded the tests for LABELS.

parent 88deaa3b
No related branches found
No related tags found
No related merge requests found
......@@ -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))))
......
;-*- 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)
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment