Make TR random tester more robust against special values.

This commit is contained in:
Vincent St-Amour 2014-03-26 14:13:57 -04:00
parent 35f7a9a0e7
commit dd943c8754

View File

@ -161,7 +161,13 @@
;; Redex can't generate reals, so we convert ints to reals.
(define (exp->real-exp E) ; numbers or symbols or lists
(cond [(number? E)
(random-integer->random-real (exact-round E))]
(random-integer->random-real
(exact-round
;; doesn't handle non-rationals
;; not a problem, we generate those specially
(if (rational? E)
E
0)))] ; arbitrary
[(list? E)
(map exp->real-exp E)]
[else