source: trunk/source/tests/ansi-tests/adjustable-array-p.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: 1.7 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Jan 20 21:25:22 2003
4;;;; Contains: Tests for ADJUSTABLE-ARRAY-P
5
6(in-package :cl-test)
7
8(deftest adjustable-array-p.1
9  (notnot (adjustable-array-p (make-array '(5) :adjustable t)))
10  t)
11
12(deftest adjustable-array-p.2
13  (notnot (adjustable-array-p (make-array nil :adjustable t)))
14  t)
15
16(deftest adjustable-array-p.3
17  (notnot (adjustable-array-p (make-array '(2 3) :adjustable t)))
18  t)
19
20(deftest adjustable-array-p.4
21  (notnot (adjustable-array-p (make-array '(2 2 2) :adjustable t)))
22  t)
23
24(deftest adjustable-array-p.5
25  (notnot (adjustable-array-p (make-array '(2 2 2 2) :adjustable t)))
26  t)
27
28(deftest adjustable-array-p.6
29  (macrolet ((%m (z) z))
30            (let ((a (make-array '(5) :adjustable t)))
31              (notnot (adjustable-array-p (expand-in-current-env (%m a))))))
32  t)
33
34(deftest adjustable-array-p.order.1
35  (let ((i 0) x)
36    (values
37     (notnot (adjustable-array-p (progn (setf x (incf i))
38                                        (make-array '(5) :adjustable t))))
39     i x))
40  t 1 1)
41
42;;; Error tests
43
44(deftest adjustable-array-p.error.1
45  (signals-error (adjustable-array-p) program-error)
46  t)
47
48(deftest adjustable-array-p.error.2
49  (signals-error (adjustable-array-p "aaa" nil) program-error)
50  t)
51
52(deftest adjustable-array-p.error.3
53  (signals-type-error x 10 (adjustable-array-p x))
54  t)
55
56(deftest adjustable-array-p.error.4
57  (check-type-error #'adjustable-array-p #'arrayp)
58  nil)
59
60(deftest adjustable-array-p.error.5
61  (signals-error (locally (adjustable-array-p 10)) type-error)
62  t)
63
64(deftest adjustable-array-p.error.6
65  (signals-error (let ((x 10))
66                    (locally (declare (optimize (safety 3)))
67                           (adjustable-array-p x)))
68                 type-error)
69  t)
Note: See TracBrowser for help on using the repository browser.