source: trunk/source/tests/ansi-tests/rctest/form-generators.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: 885 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Jun 21 10:56:09 2003
4;;;; Contains: Generators for forms
5
6(in-package :rctest)
7
8(defclass form-generator (composite-generator) ())
9
10(defparameter *form-generator* (make-instance 'composite-generator))
11
12(defclass implicit-progn-generator (random-iterative-generator)
13  ((subgenerator :initform *form-generator*)))
14
15(defgenerator var-form-generator
16  :keys (vars)
17  :body (random-from-seq vars))
18
19(defgenerator int-form-generator
20  :body (random-case
21         0
22         (random-from-seq
23          #.(apply #'vector (loop for i from 0 to 31 collect (ash 1 i))))
24         (random-from-seq
25          #.(apply #'vector (loop for i from 0 to 31 collect (- (ash 1 i)))))
26         (random-from-seq
27          #.(make-array 128 :initial-contents
28                        (loop for i from 0 to 31
29                              for x = (ash 1 i)
30                              nconc (list (1- x) (1+ x) (- 1 x) (- -1 x)))))
31         (random 1000)))
Note: See TracBrowser for help on using the repository browser.