source: trunk/source/tests/ansi-tests/array-row-major-index.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.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jan 21 21:37:03 2003
4;;;; Contains: Tests of ARRAY-ROW-MAJOR-INDEX
5
6(in-package :cl-test)
7
8;;; More array-row-major-index tests are in make-array.lsp
9
10(deftest array-row-major-index.1
11  (array-row-major-index #0aNIL)
12  0)
13
14(deftest array-row-major-index.2
15  (loop for i from 0 to 4
16        collect (array-row-major-index #(a b c d e) i))
17  (0 1 2 3 4))
18
19(deftest array-row-major-index.3
20  (let ((a (make-array '(5) :fill-pointer 1)))
21    (loop for i from 0 to 4
22          collect (array-row-major-index a i)))
23  (0 1 2 3 4))
24
25(deftest array-row-major-index.4
26  (macrolet
27   ((%m (z) z))
28   (array-row-major-index (expand-in-current-env (%m #(a b c))) 1))
29  1)
30
31(deftest array-row-major-index.5
32  (macrolet
33   ((%m (z) z))
34   (array-row-major-index #(a b c) (expand-in-current-env (%m 1))))
35  1)
36
37(deftest array-row-major-index.order.1
38  (let ((x 0) y z
39        (a #(a b c d e f)))
40    (values
41     (array-row-major-index
42      (progn (setf y (incf x)) a)
43      (progn (setf z (incf x)) 0))
44     x y z))
45  0 2 1 2)
46
47;;; Error tests
48
49(deftest array-row-major-index.error.1
50  (signals-error (array-row-major-index) program-error)
51  t)
52
Note: See TracBrowser for help on using the repository browser.