source: trunk/source/tests/ansi-tests/random-type-prop-tests-01.lsp @ 8991

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

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

File size: 3.4 KB
[8991]1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar  6 20:36:56 2005
4;;;; Contains: Test that invoke the random type prop infrastructure, part 1
6(in-package :cl-test)
8(def-type-prop-test special-operator-p 'special-operator-p '(symbol) 1)
9(def-type-prop-test type-of 'type-of '(t) 1)
10(def-type-prop-test typep.1 '(lambda (x y) (typep x (type-of y))) '(t t) 2)
11(def-type-prop-test typep.2 'typep
12  (list t #'(lambda (x)
13              (let ((type (make-random-type-containing x)))
14                `(eql ,type))))
15  2)
16(def-type-prop-test subtypep
17  '(lambda (x y) (subtypep (type-of x) (type-of y))) '(t t) 2)
18(def-type-prop-test fboundp.1 'fboundp '(symbol) 1)
19(def-type-prop-test fboundp.2 'fboundp '((cons (eql setf) (cons symbol null))) 1)
20(def-type-prop-test functionp 'functionp '(t) 1)
21(def-type-prop-test compiled-function-p 'compiled-function-p '(t) 1)
22(def-type-prop-test not 'not '(t) 1)
23(def-type-prop-test eq 'eq (list
24                            '(and t (not number) (not character))
25                            #'(lambda (x) (rcase
26                                           (1 `(eql ,x))
27                                           (1 '(and t (not number) (not character))))))
28  2)
29(def-type-prop-test eql.1 'eql '(t t) 2)
30(def-type-prop-test eql.2 'eql (list t #'(lambda (x) `(eql ,x))) 2)
31(def-type-prop-test equal.1 'equal '(t t) 2)
32(def-type-prop-test equal.2 'equal (list t #'(lambda (x) `(eql ,x))) 2)
33(def-type-prop-test equalp.1 'equalp '(t t) 2)
34(def-type-prop-test equalp.2 'equalp (list t #'(lambda (x) `(eql ,x))) 2)
35(def-type-prop-test identity 'identity '(t) 1)
36(def-type-prop-test complement
37 '(lambda (f y) (funcall (complement f) y)) (list `(eql ,#'symbolp) t) 2)
38(def-type-prop-test constantly
39  '(lambda (x) (funcall (constantly x))) '(t) 1)
40(def-type-prop-test and.1 'and '(t) 1)
41(def-type-prop-test and.2 'and '((or null t) t) 2)
42(def-type-prop-test and.3 'and '((or null t) (or null t) t) 3)
43(def-type-prop-test if.1 'if '(boolean t) 2)
44(def-type-prop-test if.2 'if '(boolean t t) 3)
45(def-type-prop-test if.3 '(lambda (p q x y z) (if p (if q x y) z))
46  '(boolean boolean t t t) 5)
47(def-type-prop-test if.4 '(lambda (p q x y z) (if p x (if q y z)))
48  '(boolean boolean t t t) 5)
49(def-type-prop-test if.5 '(lambda (p q x y) (if (or p q) x y))
50  '(boolean boolean t t) 4)
51(def-type-prop-test if.6 '(lambda (p q x y) (if (and p q) x y))
52  '(boolean boolean t t) 4)
53(def-type-prop-test cond.1 '(lambda (p x y) (cond (p x) (t y))) '(boolean t t) 3)
54(def-type-prop-test cond.2 '(lambda (p x y) (cond (p x) (t y))) '((or null t) t t) 3)
55(def-type-prop-test or.1 'or '(t) 1)
56(def-type-prop-test or.2 'or '((or null t) t) 2)
57(def-type-prop-test or.3 'or '((or null null t) (or null t) t) 3)
58(def-type-prop-test when 'when '((or null t) t) 2)
59(def-type-prop-test unless 'unless '((or null t) t) 2)
60(def-type-prop-test slot-exists-p 'slot-exists-p '(t symbol) 2)
61(def-type-prop-test find-class 'find-class '(symbol null) 2)
62(def-type-prop-test class-of 'class-of '(t) 1)
63(def-type-prop-test find-restart 'find-restart '((and symbol (not null))) 1)
64(def-type-prop-test symbolp 'symbolp '(t) 1)
65(def-type-prop-test keywordp 'keywordp '(t) 1)
66(def-type-prop-test make-symbol 'make-symbol '(string) 1
67  :test #'(lambda (x y) (string= (symbol-name x) (symbol-name y))))
68(def-type-prop-test symbol-name 'symbol-name '(symbol) 1)
69(def-type-prop-test symbol-package 'symbol-package '(symbol) 1)
70(def-type-prop-test boundp 'boundp '(symbol) 1)
71(def-type-prop-test find-symbol 'find-symbol '(string) 1)
72(def-type-prop-test find-package 'find-package '((or string symbol character)) 1)
Note: See TracBrowser for help on using the repository browser.