values-list.lsp 1004 Bytes
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Mon Jan 13 16:53:39 2003
;;;; Contains: Tests for VALUES-LIST

6

7 8

(deftest values-list.error.1
9 10
  (signals-error (values-list) program-error)
  t)
11 12

(deftest values-list.error.2
13 14
  (signals-error (values-list nil nil) program-error)
  t)
15

16
(deftest values-list.error.3
17 18
  (check-type-error #'values-list #'list)
  nil)
19 20

(deftest values-list.error.4
21 22
  (signals-error (values-list '(a b c . d)) type-error)
  t)
23

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
(deftest values-list.1
  (values-list nil))

(deftest values-list.2
  (values-list '(1))
  1)

(deftest values-list.3
  (values-list '(1 2))
  1 2)

(deftest values-list.4
  (values-list '(a b c d e f g h i j))
  a b c d e f g h i j)

(deftest values-list.5
  (let ((x (loop for i from 1 to (min 1000
sds's avatar
sds committed
41 42 43
                                      (1- call-arguments-limit)
                                      (1- multiple-values-limit))
                 collect i)))
44
    (equalt x
sds's avatar
sds committed
45
            (multiple-value-list (values-list x))))
46 47
  t)

sds's avatar
sds committed
48