source: trunk/source/tests/ansi-tests/bit-vector-p.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.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Jan 26 20:16:50 2003
4;;;; Contains: Tests of BIT-VECTOR-P
5
6(in-package :cl-test)
7
8(deftest bit-vector-p.2
9  (notnot-mv (bit-vector-p #*))
10  t)
11 
12(deftest bit-vector-p.3
13  (notnot-mv (bit-vector-p #*00101))
14  t)
15
16(deftest bit-vector-p.4
17  (bit-vector-p #(0 1 1 1 0 0))
18  nil)
19
20(deftest bit-vector-p.5
21  (bit-vector-p "011100")
22  nil)
23
24(deftest bit-vector-p.6
25  (bit-vector-p 0)
26  nil)
27
28(deftest bit-vector-p.7
29  (bit-vector-p 1)
30  nil)
31
32(deftest bit-vector-p.8
33  (bit-vector-p nil)
34  nil)
35
36(deftest bit-vector-p.9
37  (bit-vector-p 'x)
38  nil)
39
40(deftest bit-vector-p.10
41  (bit-vector-p '(0 1 1 0))
42  nil)
43
44(deftest bit-vector-p.11
45  (bit-vector-p (make-array '(2 2) :element-type 'bit
46                            :initial-element 0))
47  nil)
48
49(deftest bit-vector-p.12
50  (check-type-predicate #'bit-vector-p 'bit-vector)
51  nil)
52
53(deftest bit-vector-p.13
54  (macrolet
55   ((%m (z) z))
56   (values (notnot (bit-vector-p (expand-in-current-env (%m #*110101))))
57           (bit-vector-p (expand-in-current-env (%m nil)))))
58  t nil)
59
60(deftest bit-vector-p.order.1
61  (let ((i 0) x)
62    (values
63     (notnot (bit-vector-p (progn (setf x (incf i)) #*0010)))
64     i x))
65  t 1 1)
66
67(deftest bit-vector-p.order.2
68  (let ((i 0) x)
69    (values
70     (bit-vector-p (progn (setf x (incf i)) 'a))
71     i x))
72  nil 1 1)
73
74
75(deftest bit-vector-p.error.1
76  (signals-error (bit-vector-p) program-error)
77  t)
78
79(deftest bit-vector-p.error.2
80  (signals-error (bit-vector-p #* #*) program-error)
81  t)
Note: See TracBrowser for help on using the repository browser.