rest.lsp 466 Bytes
Newer Older
1 2 3 4 5 6 7
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Apr 19 22:49:14 2003
;;;; Contains: Tests of REST

(in-package :cl-test)

8 9
(compile-and-load "cons-aux.lsp")

10 11 12 13 14 15 16 17 18 19
(deftest rest.1
  (rest (list 'a 'b 'c))
  (b c))

(deftest rest.order.1
  (let ((i 0))
    (values (rest (progn (incf i) '(a b))) i))
  (b) 1)

(deftest rest.error.1
20 21
  (signals-error (rest) program-error)
  t)
22 23

(deftest rest.error.2
24 25
  (signals-error (rest nil nil) program-error)
  t)
26 27