File: function-lambda-expression.lsp

package info (click to toggle)
cl-ansi-tests 20071218-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,000 kB
  • ctags: 22,025
  • sloc: lisp: 134,798; makefile: 144
file content (44 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Mon Jan 13 16:27:12 2003
;;;; Contains: Tests for FUNCTION-LAMBDA-EXPRESSION

(in-package :cl-test)

(deftest function-lambda-expression.1
  (length
   (multiple-value-list
    (function-lambda-expression #'cons)))
  3)

(deftest function-lambda-expression.2
  (let ((x nil))
    (flet ((%f () x))
      (let ((ret-vals
	     (multiple-value-list
	      (function-lambda-expression #'%f))))
	(values (length ret-vals)
		(notnot (second ret-vals))))))
  3 t)

;;; Verify that it doesn't barf on generic functions
(deftest function-lambda-expression.3
  (length
   (multiple-value-list
    (function-lambda-expression
     #'meaningless-user-generic-function-for-universe)))
  3)

(deftest function-lambda-expression.order.1
  (let ((i 0))
    (function-lambda-expression (progn (incf i) #'cons))
    i)
  1)

(deftest function-lambda-expression.error.1
  (signals-error (function-lambda-expression) program-error)
  t)

(deftest function-lambda-expression.error.2
  (signals-error (function-lambda-expression #'cons nil) program-error)
  t)