>
> > Are you using emacs racket-mode?
>
> I am, almost exclusively. Exception and check failure locations can be a 
> pain, but they work in general.
>
 
What Eric said :) But when in doubt I always compare behavior with DrRacket 
and raco, and racket-mode stands tall here and does at least what they do, 
so it isn't one to point fingers at.
 

> The third check is never invoked. While evaluating the argument, f throws 
> an exception and the REPL gives no useful context. I think you're asking 
> specifically about this case. If the error is in the code being tested and 
> not in the test itself, I'd want to know where the exception was raised.
>
> In Emacs, hitting C-u C-c C-c inside the test sub-module exposes the 
> context I'm looking for:
>
> ; ...
> --------------------
> ; error: FAIL
> ; Context (errortrace):
> ;    /tmp/somefile.rkt:2:15: (error (quote FAIL))
> ; ...
>


Eric, that's exactly what I'm asking about - perfect example - thank you. 
However that "context" you speak of isn't terribly helpful. It does indeed 
point where error occurs - ok'ish when its in the surrounding module you 
control, completely useless when its in some library or collection or 
kernel - but notice how it doesn't tell you which (check ...) triggered it, 
so if you have many of those, how in the world could you tell? That 
f-function that throws could be called by any number of other functions and 
code. See what I mean?

 

> If I'm generating tests with macros, getting the source locations right 
> can be a hassle. Sometimes, it's easier to just add with-check-info:
>

Oh wow, this is great. Wasn't aware of this nifty macro! I can see how I 
could wrap every rackunit check in something that effectively names it, so 
that you could see who triggered an error. Just like in your example. 
That's basically wrapping rackunit with your preferred interface - requires 
work, but would help. Your solution comes very close to what I want. I 
wonder why something like this isn't the default. Simply haven't the time 
to implement and provide it to public, or people don't usually feel the 
need for it? If the latter, then is my test-debug flow doesn't match what 
Racket expects me to do?

 Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to