> <span style="font-family:arial,sans-serif;font-size:13px">Yeah, that is very nice! (It should begin with "check" not "test" tho, right?)</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Indeed; Jonah was writing w.r.t plai, which uses test. Should use check- in rackunit.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I noticed that this also violates, from the rackunit docs:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">"</span><span style="color:rgb(0,0,0);font-family:serif;font-size:medium;text-align:left">Although checks are implemented as macros, which is necessary to grab source location, they are conceptually functions. This means, for instance, checks always evaluate their arguments."</span></div>
<div><span style="color:rgb(0,0,0);font-family:serif;font-size:medium;text-align:left"><br></span></div><div style="text-align:left">I suppose this should go in a separate section of "additional checks" or some such?</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 19, 2012 at 8:01 PM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah, that is very nice! (It should begin with "check" not "test" tho, right?)<span class="HOEnZb"><font color="#888888"><div>
<br></div></font></span><div><span class="HOEnZb"><font color="#888888">Robby</font></span><div><div class="h5"><br><br>On Monday, November 19, 2012, Matthias Felleisen wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That is cute. Why don't you just create a pull request and Ryan can integrate it into rackunit? -- Matthias<br>
<br>
<br>
<br>
<br>
<br>
On Nov 19, 2012, at 4:22 PM, Joe Gibbs Politz wrote:<br>
<br>
> A small suggestion:<br>
><br>
> I used roughly this macro (credit Jonah Kagan) recently to help me write some tests for parsing code that agnostic to which source position is generated in the parse:<br>
><br>
> (define-syntax test/match<br>
> (syntax-rules ()<br>
> [(test/match actual expected pred)<br>
> (let ([actual-val actual])<br>
> (with-check-info* (list (make-check-actual actual-val)<br>
> (make-check-expected 'expected))<br>
> (thunk (check-true (match actual-val<br>
> [expected pred]<br>
> [_ false])))))]<br>
><br>
> [(test/match actual expected)<br>
> (test/match actual expected true)]))<br>
><br>
> Shriram remarked that he was surprised some sort of check-match wasn't in rackunit already. Is it worth adding something like this?<br>
><br>
> I'm doing things like:<br>
><br>
> (test/match (parse "5 'foo'") (s-block _ (list (s-num _ 5) (s-str _ "foo"))))<br>
><br>
> Where the structs s-block, s-num, and s-str all expect a srcloc as their first argument, but I don't care about it for these tests.<br>
><br>
> The actual use is at:<br>
><br>
> <a href="https://github.com/brownplt/pyret-lang/blob/master/src/tests/parse-tests.rkt#L36" target="_blank">https://github.com/brownplt/pyret-lang/blob/master/src/tests/parse-tests.rkt#L36</a><br>
><br>
> That file would be much, much uglier without this macro.<br>
><br>
> Cheers,<br>
> Joe P.<br>
><br>
> _________________________<br>
> Racket Developers list:<br>
> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br>
</blockquote></div></div></div>
</blockquote></div><br></div>