source: trunk/source/tests/ansi-tests/rationalp.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 868 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Sep  7 08:36:31 2003
4;;;; Contains: Tests of RATIONALP
5
6(in-package :cl-test)
7
8(deftest rationalp.error.1
9  (signals-error (rationalp) program-error)
10  t)
11
12(deftest rationalp.error.2
13  (signals-error (rationalp 0 nil) program-error)
14  t)
15
16(deftest rationalp.error.3
17  (signals-error (rationalp 'a 0) program-error)
18  t)
19
20(deftest rationalp.1
21  (loop for x in *rationals*
22        for vals = (multiple-value-list (rationalp x))
23        unless (and (= (length vals) 1)
24                    (first vals))
25        collect (cons x vals))
26  nil)
27
28(deftest rationalp.2
29  (loop for x in (set-difference *universe* *rationals*)
30        for vals = (multiple-value-list (rationalp x))
31        unless (and (= (length vals) 1)
32                    (null (first vals)))
33        collect (cons x vals))
34  nil)
35
36(deftest rationalp.3
37  (check-type-predicate #'rationalp 'rational)
38  nil)
39
40
Note: See TracBrowser for help on using the repository browser.