source: trunk/source/tests/ansi-tests/listp.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 862 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Apr 19 22:03:37 2003
4;;;; Contains: Tests of LISTP
5
6(in-package :cl-test)
7
8(compile-and-load "cons-aux.lsp")
9
10(deftest listp-nil
11  (notnot-mv (listp nil))
12  t)
13
14(deftest listp-symbol
15  (listp 'a)
16  nil)
17
18(deftest listp-singleton-list
19  (notnot-mv (listp '(a)))
20  t)
21
22(deftest listp-circular-list
23  (let ((x (cons nil nil)))
24    (setf (cdr x) x)
25    (notnot-mv (listp x)))
26  t)
27
28(deftest listp-longer-list
29  (notnot-mv (listp '(a b c d e f g h)))
30  t)
31
32;;; Check that (listp x) == (typep x 'list)
33
34(deftest listp-universe
35  (check-type-predicate 'listp 'list)
36  nil)
37
38(deftest listp.order.1
39  (let ((i 0))
40    (values (listp (incf i)) i))
41  nil 1)
42
43(deftest listp.error.1
44  (signals-error (listp) program-error)
45  t)
46
47(deftest listp.error.2
48  (signals-error (listp nil nil) program-error)
49  t)
Note: See TracBrowser for help on using the repository browser.