minusp.lsp 1.35 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Mon Aug  4 21:33:44 2003
;;;; Contains: Tests of MINUSP

6

pfdietz's avatar
pfdietz committed
7 8

(deftest minusp.error.1
9 10
  (signals-error (minusp) program-error)
  t)
pfdietz's avatar
pfdietz committed
11 12

(deftest minusp.error.2
13 14
  (signals-error (minusp 0 0) program-error)
  t)
pfdietz's avatar
pfdietz committed
15 16

(deftest minusp.error.3
17 18
  (signals-error (minusp 0 nil) program-error)
  t)
pfdietz's avatar
pfdietz committed
19 20

(deftest minusp.error.4
pfdietz's avatar
pfdietz committed
21
  (check-type-error #'minusp #'realp)
pfdietz's avatar
pfdietz committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
  nil)

(deftest minusp.1
  (minusp 0)
  nil)

(deftest minusp.2
  (notnot-mv (minusp -1))
  t)

(deftest minusp.3
  (minusp 1)
  nil)

(deftest minusp.4
  (loop for x in *reals*
sds's avatar
sds committed
38 39
        when (if (minusp x) (>= x 0) (< x 0))
        collect x)
pfdietz's avatar
pfdietz committed
40 41 42 43 44 45 46 47
  nil)

(deftest minusp.5
  (some #'minusp '(-0.0s0 -0.0f0 -0.0d0 -0.0l0))
  nil)

(deftest minusp.6
  (remove-if #'minusp
sds's avatar
sds committed
48 49 50 51 52 53 54 55 56 57 58 59
             (list least-negative-short-float
                   least-negative-normalized-short-float
                   least-negative-single-float
                   least-negative-normalized-single-float
                   least-negative-double-float
                   least-negative-normalized-double-float
                   least-negative-long-float
                   least-negative-normalized-long-float
                   most-negative-short-float
                   most-negative-single-float
                   most-negative-double-float
                   most-negative-long-float))
pfdietz's avatar
pfdietz committed
60
  nil)