simple-vector-p.lsp 1.46 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5 6 7 8 9 10
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Wed Jan 22 21:23:45 2003
;;;; Contains: Tests for SIMPLE-VECTOR-P

(in-package :cl-test)

;;; More tests for this are in make-array.lsp

(deftest simple-vector-p.1
11
  (check-type-predicate #'simple-vector-p 'simple-vector)
pfdietz's avatar
pfdietz committed
12 13 14
  nil)

(deftest simple-vector-p.2
15
  (notnot-mv (simple-vector-p (make-array '(10))))
pfdietz's avatar
pfdietz committed
16 17
  t)

18 19 20
;; (deftest simple-vector-p.3
;;  (simple-vector-p (make-array '(5) :fill-pointer t))
;;  nil)
pfdietz's avatar
pfdietz committed
21 22

(deftest simple-vector-p.4
23
  (notnot-mv (simple-vector-p (vector 'a 'b 'c)))
pfdietz's avatar
pfdietz committed
24 25
  t)

26 27 28
;;; (deftest simple-vector-p.5
;;;  (simple-vector-p (make-array '(5) :adjustable t))
;;;  nil)
pfdietz's avatar
pfdietz committed
29

30 31 32 33
;;; (deftest simple-vector-p.6
;;;  (let ((a #(a b c d e g h)))
;;;    (simple-vector-p (make-array '(5) :displaced-to a)))
;;;   nil)
pfdietz's avatar
pfdietz committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

(deftest simple-vector-p.7
  (simple-vector-p #*001101)
  nil)

(deftest simple-vector-p.8
  (simple-vector-p "abcdef")
  nil)

(deftest simple-vector-p.9
  (simple-vector-p (make-array nil))
  nil)

(deftest simple-vector-p.10
  (simple-vector-p (make-array '(10) :element-type 'base-char))
  nil)

(deftest simple-vector-p.11
  (simple-vector-p (make-array '(10) :element-type 'character))
  nil)

(deftest simple-vector-p.12
  (simple-vector-p (make-array '(10) :element-type 'bit))
  nil)

;;; Error tests

(deftest simple-vector-p.error.1
62 63
  (signals-error (simple-vector-p) program-error)
  t)
pfdietz's avatar
pfdietz committed
64 65

(deftest simple-vector-p.error.2
66 67
  (signals-error (simple-vector-p #(a b) nil) program-error)
  t)