<div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"> Good because library dependencies are reduced, but bad because tests 
are somewhat &quot;disconnected&quot; from the functions they are testing.</blockquote><div><br>AFAIK, it&#39;s a good engineering practice to separate the tests from the code they are supposed to test. Code management issues will be there, but those can be taken care with the help of cabal like tool.<br>


</div>That way, a person who wants to test will use the test-files and the one who doesn&#39;t want will be spared the trouble of separating tests from the intended function code.<br><br>Regards,<br> Damodar <br><br> </div>

<div class="gmail_quote">On Thu, Jul 19, 2012 at 1:46 PM, Lorenzo Bolla <span dir="ltr">&lt;<a href="mailto:lbolla@gmail.com" target="_blank">lbolla@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div><br></div><div>I&#39;m writing some library code and I have hunit-tests and quickcheck-tests. I&#39;m facing the problem of where to put these tests. These are the options I can think of:</div>


<div><ul><li>Put the tests for a function in the same file where the function is defined. This is good because tests are close to the code being tested and work as a sort of documentation for it. But it&#39;s bad because the file requires HUnit, QuickCheck, Test.Framework, etc. to compile.</li>



<li>Same as above, but use some sort of preprocessing flag to ignore the Test suite when compiling the library (hence no dependencies on test libraries), but leave the code in place. No dependencies, but ugly.</li><li>Put the tests in completely separate files. Good because library dependencies are reduced, but bad because tests are somewhat &quot;disconnected&quot; from the functions they are testing.</li>



</ul><div>What do you expert suggest? How should I organize my test suites?</div></div><div>(The same conundrum applies to benchmarking code.)</div><div><br></div><div>Thanks,</div><div>Lorenzo</div>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br><br clear="all"><br>