identity.lsp 653 Bytes
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Thu Oct 17 23:21:11 2002
;;;; Contains: Tests for IDENTITY

6

7 8

(deftest identity.1
9 10
  (check-predicate #'(lambda (x) (eqlt x (check-values (identity x)))))
  nil)
11 12 13

(deftest identity.2
  (let ((x (ash 1 100)))
14
    (eqlt x (check-values (identity x))))
15 16 17 18
  t)

(deftest identity.3
  (let ((x 1.00000001))
19
    (eqlt x (check-values (identity x))))
20
  t)
21

22 23 24 25 26
(deftest identity.order.1
  (let ((i 0))
    (values (identity (incf i)) i))
  1 1)

27
(deftest identity.error.1
28 29
  (signals-error (identity) program-error)
  t)
30 31

(deftest identity.error.2
32 33 34
  (signals-error (identity 'a 'a) program-error)
  t)