imagpart.lsp 1.01 KB
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun Sep  7 07:47:43 2003
;;;; Contains: Tests of IMAGPART

6

7 8

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

(deftest imagpart.error.2
13 14
  (signals-error (imagpart #c(1.0 2.0) nil) program-error)
  t)
15 16

(deftest imagpart.error.3
17
  (check-type-error #'imagpart #'numberp)
18 19 20 21
  nil)

(deftest imagpart.1
  (loop for x in *reals*
sds's avatar
sds committed
22 23 24 25
        for c = (complex 0 x)
        for ip = (imagpart c)
        unless (eql x ip)
        collect (list x c ip))
26 27 28 29
  nil)

(deftest imagpart.2
  (loop for x in *reals*
sds's avatar
sds committed
30 31 32 33
        for c = (complex 1 x)
        for ip = (imagpart c)
        unless (eql x ip)
        collect (list x c ip))
34 35 36 37
  nil)

(deftest imagpart.3
  (loop for x in *reals*
sds's avatar
sds committed
38 39 40 41
        for c = (complex x x)
        for ip = (imagpart c)
        unless (eql x ip)
        collect (list x c ip))
42 43 44 45
  nil)

(deftest imagpart.4
  (loop for x in *reals*
sds's avatar
sds committed
46 47 48
        for ip = (imagpart x)
        unless (eql (* 0 x) ip)
        collect (list x ip (* 0 x)))
49 50 51
  nil)