array-element-type.lsp 876 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Contains: Tests of the function ARRAY-ELEMENT-TYPE

(in-package :cl-test)

;;; Mosts tests are in other files, incidental to testing of
;;; other things

(deftest array-element-type.1
  (macrolet ((%m (z) z))
sds's avatar
sds committed
12
            (notnot (array-element-type (expand-in-current-env (%m #(a b c))))))
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
  t)

(deftest array-element-type.order.1
  (let ((i 0))
    (array-element-type (progn (incf i) #(a b c)))
    i)
  1)

;;; Error tests

(deftest array-element-type.error.1
  (signals-error (array-element-type) program-error)
  t)

(deftest array-element-type.error.2
  (signals-error (array-element-type #(a b c) nil) program-error)
  t)

(deftest array-element-type.error.3
  (check-type-error #'array-element-type #'arrayp)
  nil)

(deftest array-element-type.error.4
  (signals-type-error x nil (array-element-type x))
  t)