Commit 6855e189 authored by pfdietz's avatar pfdietz

Tests for minusp, plusp.

parent 8c731de1
......@@ -9,3 +9,5 @@
(load "number-comparison.lsp")
(load "max.lsp")
(load "min.lsp")
(load "minusp.lsp")
(load "plusp.lsp")
......@@ -19,6 +19,14 @@
collect x)
nil)
(deftest min.error.3
(loop for x in *mini-universe*
unless (or (realp x)
(eq (classify-error** `(classify-error (min 0 ',x)))
'type-error))
collect x)
nil)
(deftest min.1
(loop for n in *reals*
when (or (not (eql (min n) n))
......
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Mon Aug 4 21:33:44 2003
;;;; Contains: Tests of MINUSP
(in-package :cl-test)
(deftest minusp.error.1
(classify-error (minusp))
program-error)
(deftest minusp.error.2
(classify-error (minusp 0 0))
program-error)
(deftest minusp.error.3
(classify-error (minusp 0 nil))
program-error)
(deftest minusp.error.4
(loop for x in *mini-universe*
unless (realp x)
unless (eql (classify-error** `(minusp ',x)) 'type-error)
collect x)
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*
when (if (minusp x) (>= x 0) (< x 0))
collect x)
nil)
(deftest minusp.5
(some #'minusp '(-0.0s0 -0.0f0 -0.0d0 -0.0l0))
nil)
(deftest minusp.6
(remove-if #'minusp
(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))
nil)
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Mon Aug 4 21:42:14 2003
;;;; Contains: Tests for PLUSP
(in-package :cl-test)
(deftest plusp.error.1
(classify-error (plusp))
program-error)
(deftest plusp.error.2
(classify-error (plusp 0 0))
program-error)
(deftest plusp.error.3
(classify-error (plusp 0 nil))
program-error)
(deftest plusp.error.4
(loop for x in *mini-universe*
unless (realp x)
unless (eql (classify-error** `(plusp ',x)) 'type-error)
collect x)
nil)
(deftest plusp.1
(plusp 0)
nil)
(deftest plusp.2
(plusp -1)
nil)
(deftest plusp.3
(notnot-mv (plusp 1))
t)
(deftest plusp.4
(loop for x in *reals*
when (if (plusp x) (<= x 0) (> x 0))
collect x)
nil)
(deftest plusp.5
(some #'plusp '(-0.0s0 -0.0f0 -0.0d0 -0.0l0))
nil)
(deftest plusp.6
(some #'plusp '(0.0s0 0.0f0 0.0d0 0.0l0))
nil)
(deftest plusp.7
(remove-if #'plusp
(list least-positive-short-float
least-positive-normalized-short-float
least-positive-single-float
least-positive-normalized-single-float
least-positive-double-float
least-positive-normalized-double-float
least-positive-long-float
least-positive-normalized-long-float
most-positive-short-float
most-positive-single-float
most-positive-double-float
most-positive-long-float))
nil)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment