<div>A small suggestion:</div><div><br></div>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><div>
<font face="courier new, monospace">(define-syntax test/match</font></div><div><font face="courier new, monospace"> (syntax-rules ()</font></div><div><font face="courier new, monospace"> [(test/match actual expected pred)</font></div>
<div><font face="courier new, monospace"> (let ([actual-val actual])</font></div><div><font face="courier new, monospace"> (with-check-info* (list (make-check-actual actual-val)</font></div><div><font face="courier new, monospace"> (make-check-expected 'expected))</font></div>
<div><font face="courier new, monospace"> (thunk (check-true (match actual-val</font></div><div><font face="courier new, monospace"> [expected pred]</font></div>
<div><font face="courier new, monospace"> [_ false])))))]</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> [(test/match actual expected)</font></div>
<div><font face="courier new, monospace"> (test/match actual expected true)]))</font></div><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>
<div><br></div><div>I'm doing things like:</div><div><br></div><div><font face="courier new, monospace">(test/match (parse "5 'foo'") (s-block _ (list (s-num _ 5) (s-str _ "foo"))))</font><br>
</div><div><font face="courier new, monospace"><br></font></div><div>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.</div><div><br></div>
<div>The actual use is at:</div><div><br></div><div><a href="https://github.com/brownplt/pyret-lang/blob/master/src/tests/parse-tests.rkt#L36">https://github.com/brownplt/pyret-lang/blob/master/src/tests/parse-tests.rkt#L36</a><br>
</div><div><br></div><div>That file would be much, much uglier without this macro.</div><div><br></div><div>Cheers,</div><div>Joe P.</div><div><br></div>