compiled-function-p.lsp 812 Bytes
Newer Older
1 2 3 4 5 6 7 8
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Mon Jan 13 16:32:44 2003
;;;; Contains: Tests of COMPILED-FUNCTION-P

(in-package :cl-test)

(deftest compiled-function-p.1
9
  (check-type-predicate #'compiled-function-p 'compiled-function)
10 11 12 13 14 15 16
  nil)

(deftest compiled-function-p.2
  (compiled-function-p '(lambda (x y) (cons y x)))
  nil)

(deftest compiled-function-p.3
17 18
  (notnot-mv (compiled-function-p (compile nil '(lambda (y x) (cons x y)))))
  t)
19

20 21 22 23 24 25 26
(deftest compiled-function-p.order.1
  (let ((i 0))
    (values
     (compiled-function-p (progn (incf i) '(lambda () nil)))
     i))
  nil 1)

27
(deftest compiled-function-p.error.1
28 29
  (signals-error (compiled-function-p) program-error)
  t)
30 31

(deftest compiled-function-p.error.2
32 33
  (signals-error (compiled-function-p nil nil) program-error)
  t)