[racket] get-uncovered-expressions
On Jul 21, Nadeem Abdul Hamid wrote:
> Sorry if I am missing something obvious, by why does the following
> produce '() ?
>
> (define Ev
> (parameterize ([sandbox-coverage-enabled #t])
> (make-evaluator 'lang/htdp-intermediate
> `(define (f x)
> (if (zero? x) "zero" "non-zero"))
> `(f 4)
> )))
> (get-uncovered-expressions Ev)
>
>
> I would have expected it to indicate somehow that the "zero" case is
> not covered?
I can't produce a more thorough answer now, but in general the whole
uncovered expressions feature relies on expressions with a source
indication. For example, this works as you expect:
(define Ev
(parameterize ([sandbox-coverage-enabled #t])
(make-evaluator 'lang/htdp-intermediate
"(define (f x)
(if (zero? x) \"zero\" \"non-zero\"))
(f 4)"
)))
(get-uncovered-expressions Ev)
and it should also work for a sandbox that is created from a file.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!