[racket] Getting test-engine to work with #lang racket

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Sun Sep 18 20:30:37 EDT 2011

On Sep 18, 2011, at 8:21 PM, Luke Vilnis wrote:

> I was wondering how to get test-engine working with #lang, or non- 
> student languages in general. I tried something like this:
> #lang racket
> (require test-engine/racket-tests)
> (check-expect 12 (+ 6 7)) ;;sic
> But no luck. I also tried it with (require test-engine/racket-gui),  
> but I'm guessing I must be missing something really basic here  
> because I can't even get it to work textually. I type (run-tests),  
> (test), (display-results), pretty much anything I can think of at  
> the repl, and I get nothing. It's as if all my output is going to  
> some hidden buffer somewhere. It works fine (sans the require)  
> using HTDP languages, so I don't think it's a problem with my install.

Did you try (test) at the end of the definitions pane?

In the student languages, check-expect is given the magical ability  
to run automatically after a complete pass through everything else.   
I haven't looked at the code for test-engine/racket-tests, but that  
version of check-expect is less magical: it still doesn't run  
immediately (so you can still put test cases for a function ahead of  
the function's definition), but you have to explicitly say "(test)"  
to get it to run at all.

Stephen Bloch
sbloch at adelphi.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110918/cd9ecc05/attachment.html>

Posted on the users mailing list.