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

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

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

File size: 919 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Apr 19 22:38:12 2003
4;;;; Contains: Tests of NRECONC
5
6(in-package :cl-test)
7
8(compile-and-load "cons-aux.lsp")
9
10(deftest nreconc.1
11  (let* ((x (list 'a 'b 'c))
12         (y (copy-tree '(d e f)))
13         (result (nreconc x y)))
14    (and (equal y '(d e f))
15         result))
16  (c b a d e f))
17
18(deftest nreconc.2
19  (nreconc nil 'a)
20  a)
21
22(deftest nreconc.order.1
23  (let ((i 0) x y)
24    (values
25     (nreconc (progn (setf x (incf i)) (copy-list '(a b c)))
26              (progn (setf y (incf i)) (copy-list '(d e f))))
27     i x y))
28  (c b a d e f) 2 1 2)
29
30(deftest nreconc.error.1
31  (signals-error (nreconc) program-error)
32  t)
33
34(deftest nreconc.error.2
35  (signals-error (nreconc nil) program-error)
36  t)
37
38(deftest nreconc.error.3
39  (signals-error (nreconc nil nil nil) program-error)
40  t)
41
42(deftest nreconc.error.4
43  (signals-error (nreconc (cons 'a 'b) (list 'z)) type-error)
44  t)
Note: See TracBrowser for help on using the repository browser.