endp.lsp 716 Bytes
Newer Older
1 2 3
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Mar 28 07:34:40 1998
4
;;;; Contains: Tests of ENDP
5 6 7

(in-package :cl-test)

8
(compile-and-load "cons-aux.lsp")
9 10

(deftest endp-nil
11
  (notnot-mv (endp nil))
12 13 14
  t)

(deftest endp-cons
15
  (endp (cons 'a 'a))
16 17 18
  nil)

(deftest endp-singleton-list
19
  (endp '(a))
20 21
  nil)

22 23 24 25 26 27 28
(deftest endp.order.1
  (let ((i 0))
    (values
     (endp (progn (incf i) '(a b c)))
     i))
  nil 1)

29 30 31
(deftest endp.error.1
  (check-type-error #'endp #'listp)
  nil)
32

33
(deftest endp.error.4
34 35
  (signals-error (endp) program-error)
  t)
36 37

(deftest endp.error.5
38 39
  (signals-error (endp nil nil) program-error)
  t)
40 41

(deftest endp.error.6
42 43
  (signals-error (locally (endp 1)) type-error)
  t)