source: trunk/source/tests/ansi-tests/array-rank.lsp @ 8991

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

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

File size: 1.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jan 21 20:32:57 2003
4;;;; Contains: Tests for ARRAY-RANK
5
6(in-package :cl-test)
7
8;;; Most tests for ARRAY-RANK are in make-array.lsp
9
10(deftest array-rank.1
11  (array-rank #0aNIL)
12  0)
13
14(deftest array-rank.2
15  (check-predicate #'(lambda (e) (or (not (typep e 'vector))
16                                     (eql (array-rank e) 1))))
17  nil)
18
19(deftest array-rank.3
20  (macrolet ((%m (z) z)) (array-rank (expand-in-current-env (%m "abc"))))
21  1)
22
23(deftest array-rank.order.1
24  (let ((i 0) a)
25    (values
26     (array-rank (progn (setf a (incf i)) "abcd"))
27     i a))
28  1 1 1)
29
30;;; Error tests
31
32(deftest array-rank.error.1
33  (signals-error (array-rank) program-error)
34  t)
35
36(deftest array-rank.error.2
37  (signals-error (array-rank #(a b c) nil)  program-error)
38  t)
39
40(deftest array-rank.error.3
41  (check-type-error #'array-rank #'arrayp)
42  nil)
43
44(deftest array-rank.error.4
45  (signals-error (array-rank nil) type-error)
46  t)
47
48(deftest array-rank.error.5
49  (signals-type-error x nil (locally (array-rank x) t))
50  t)
Note: See TracBrowser for help on using the repository browser.