source: trunk/source/tests/ansi-tests/vector-pop.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:  Fri Jan 24 07:46:29 2003
4;;;; Contains: Tests for VECTOR-POP
5
6(in-package :cl-test)
7
8(deftest vector-pop.1
9  (let ((v (make-array '(5) :initial-contents '(a b c d e)
10                       :fill-pointer 3)))
11    (values
12     (length v)
13     (check-values (vector-pop v))
14     (fill-pointer v)
15     (length v)
16     v))
17  3 c 2 2 #(a b))
18
19;;; Error cases
20
21(deftest vector-pop.error.1
22  (signals-error (let ((v (vector 1 2 3)))
23                   (if (array-has-fill-pointer-p v)
24                       (error 'type-error :datum v :expected-type nil)
25                     (vector-pop v)))
26                 type-error)
27  t)
28
29(deftest vector-pop.error.2
30  (let ((v (make-array '(5) :initial-element 'x
31                       :fill-pointer 0)))
32    (handler-case (vector-pop v)
33                  (error () 'error)))
34  error)
35
36(deftest vector-pop.error.3
37  (signals-error (vector-pop) program-error)
38  t)
39
40(deftest vector-pop.error.4
41  (signals-error (let ((v (make-array '(5) :fill-pointer t
42                                       :initial-element 'x)))
43                    (vector-pop v nil))
44                 program-error)
45  t)
Note: See TracBrowser for help on using the repository browser.