procedure
( contract-random-generate ctc[fuelfail])→any/c
ctc:contract?
The generator may fail to generate a value, either because some contracts do not have corresponding generators (for example, not all predicates have generators) or because there is not enough fuel. In either case, the function fail is invoked. If fail accepts an argument, it is called with #t when there is no generator for ctc and called with #f when there is a generator, but the generator ended up returning contract-random-generate-fail .
'(#f #f #f #f #f #f 761013102.0 -29913301 #f -174.0)
Changed in version 6.1.1.5 of package base: Allow fail to accept a boolean.
procedure
#:shuffle?shuffle?]val:any/c
Uses value-contract to determine if any of the vals have a contract and, for those that do, uses information about the contract’s shape to poke and prod at the value. For example, if the value is function, it will use the contract to tell it what arguments to supply to the value.
The argument fuel determines how hard contract-exercise tries to break the values. It controls both the number of exercise iterations and the size of the intermediate values generated during the exercises.
The argument shuffle? controls whether contract-exercise randomizes the exercise order or not. If shuffle? is not #f, contract-exercise would shuffle the order of the contracts in each exercise iteration.
returns-false: broke its own contract
promised: integer?
produced: #f
in: the range of
(-> integer? integer?)
contract from: (function returns-false)
blaming: (function returns-false)
(assuming the contract is correct)
at: eval:2:0
;f returns an integer, but;we're supposed to return a boolean(f11))calls-its-argument-with-eleven: broke its own contract
promised: boolean?
produced: 116.0
in: the range of
(-> (-> integer? integer?) boolean?)
contract from:
(function calls-its-argument-with-eleven)
blaming: (function calls-its-argument-with-eleven)
(assuming the contract is correct)
at: eval:4:0
Changed in version 7.0.0.18 of package base: Added the shuffle? optional argument.
procedure
( contract-random-generate/choose cfuel)→(or/c #f(-> c))
contract-random-generate/choose will never fail, but it might escape back to an enclosing call or to the original call to contract-random-generate .
It chooses one of several possible generation strategies, and thus it may not actually use the generator associated with c, but might instead use a stashed value that matches c that it knows about via contract-random-generate-stash .
Added in version 6.1.1.5 of package base.
Added in version 6.1.1.5 of package base.
procedure
v:any/c
Added in version 6.1.1.5 of package base.
procedure
v:any/c
Added in version 6.1.1.5 of package base.
procedure
( contract-random-generate-stash envcv)→void?
v:c
Added in version 6.1.1.5 of package base.
Added in version 6.1.1.5 of package base.