cons-test-03.lsp 719 Bytes
Newer Older
1 2 3 4 5 6
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Mar 28 07:32:20 1998
;;;; Contains: Testing of CL Features related to "CONS", part 3

(in-package :cl-test)
7

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

10 11 12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; (typep <obj> 'list)

13
;;; These tests are now somewhat redundant
14 15

(deftest typep-nil-list
16
  (notnot-mv (typep nil 'list))
17 18 19
  t)

(deftest typep-symbol-list
20
  (typep 'a 'list)
21 22 23
  nil)

(deftest typep-singleton-list-list
24
  (notnot-mv (typep '(a) 'list))
25 26 27
  t)

(deftest typep-circular-list-list
28 29 30
  (let ((x (cons nil nil)))
    (setf (cdr x) x)
    (notnot-mv (typep x 'list)))
31 32 33
  t)

(deftest typep-longer-list-list
34
  (notnot-mv (typep '(a b c d e f g h) 'list))
35
  t)