~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/copy-tree.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;-*- Mode:     Lisp -*-
 
2
;;;; Author:   Paul Dietz
 
3
;;;; Created:  Sat Apr 19 21:31:33 2003
 
4
;;;; Contains: Tests of COPY-TREE
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(compile-and-load "cons-aux.lsp")
 
9
 
 
10
;; Try copy-tree on a tree containing elements of various kinds
 
11
(deftest copy-tree.1
 
12
  (let* ((x (cons 'a (list
 
13
                     (cons 'b 'c)
 
14
                     (cons 1 1.2)
 
15
                     (list (list "abcde"
 
16
                                 (make-array '(10) :initial-element
 
17
                                             (cons 'e 'f)))
 
18
                                'g))))
 
19
         (y (copy-tree x)))
 
20
    (check-cons-copy x y))
 
21
  t)
 
22
 
 
23
;; Try copy-tree on *universe*
 
24
(deftest copy-tree.2
 
25
  (let* ((x (copy-list *universe*))
 
26
         (y (copy-tree x)))
 
27
    (check-cons-copy x y))
 
28
  t)
 
29
 
 
30
(deftest copy-tree.order.1
 
31
  (let ((i 0))
 
32
    (values
 
33
     (copy-tree (progn (incf i) '(a b c)))
 
34
     i))
 
35
  (a b c) 1)
 
36
 
 
37
;;; Error tests
 
38
 
 
39
(deftest copy-tree.error.1
 
40
  (signals-error (copy-tree) program-error)
 
41
  t)
 
42
 
 
43
(deftest copy-tree.error.2
 
44
  (signals-error (copy-tree 'a 'b) program-error)
 
45
  t)