<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>We don't test contracts. In general contracts are relatively simple functions, but yes, we have written several papers on bugs in contracts and how this complicates a contract monitoring system. </div><div><br></div><div>If you are asking how to test functions that have contracts, I import that module itself into a submodule so that the export contracts are exercised during a test: </div><div><br></div><div><div>#lang racket</div><div><br></div><div>(provide</div><div> (contract-out </div><div> (f (-> integer? integer?))))</div><div><br></div><div>(define (f x) </div><div> pi)</div><div><br></div><div>(module+ test </div><div> (require (submod "..") rackunit)</div><div> (check-equal? (f 1) 3))</div></div><div><br></div><div><br></div><div><br></div><br><div><div>On Aug 29, 2013, at 11:35 PM, Alvin Schatte wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<div>I learned a lot from this thread. Thank you for the guidance.
Along similar lines, what would be a good practice for testing contracts?</div>
<div style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">Alvin
Schatte<br></div></div></div></div>
</blockquote></div><br></body></html>