copy-list.lsp 832 Bytes
Newer Older
1 2 3 4 5 6 7
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Apr 19 21:55:19 2003
;;;; Contains: Tests of COPY-LIST

(in-package :cl-test)

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

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
(deftest copy-list.1
  (check-copy-list '(a b c d))
  (a b c d))

;; Check that copy-list works on dotted lists

(deftest copy-list.2
  (check-copy-list '(a . b))
 (a . b))

(deftest copy-list.3
  (check-copy-list '(a b c . d))
  (a b c . d))

(deftest copy-list.4
  (let ((i 0))
    (values (copy-list (progn (incf i) '(a b c)))
sds's avatar
sds committed
27
            i))
28 29
  (a b c) 1)

pfdietz's avatar
pfdietz committed
30 31 32
(def-fold-test copy-list.fold.1 (copy-list '(a b c d)))
(def-fold-test copy-list.fold.2 (copy-list '(a . b)))

33 34
;;; Error tests

35
(deftest copy-list.error.1
36 37
  (signals-error (copy-list) program-error)
  t)
38 39

(deftest copy-list.error.2
40 41
  (signals-error (copy-list nil nil) program-error)
  t)