<?xml version="1.0" encoding="windows-1252"?>
<node id="950224" title="Re^3: TDD of non-module code" created="2012-01-26 16:53:36" updated="2012-01-26 16:53:36">
<type id="11">
note</type>
<author id="155973">
grantm</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;This is my first attempt at TDD in Perl. I'm using Test::Simple and nothing more complicated than &lt;code&gt;ok&lt;/code&gt;.&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;The Test-Simple distribution includes the Test::More module - since you already have it installed, you might as well use it.  For an example of how this will improve your life, consider this test:&lt;/p&gt;

&lt;code&gt;
ok(animal() eq 'monkey', 'animal() returned monkey')
&lt;/code&gt;

&lt;p&gt;Using the &lt;code&gt;is&lt;/code&gt; function from Test::More the same test might be written like this:&lt;/p&gt;

&lt;code&gt;
is(animal(), 'monkey', 'check animal() return value')
&lt;/code&gt;

&lt;p&gt;The difference is that when your test fails, the diagnostic output will tell you what value was expected and what was actually received - making things much easier to debug.&lt;/p&gt;

&lt;p&gt;Test::More has a number of handy functions like this which &lt;i&gt;will&lt;/i&gt; save your time.&lt;/p&gt;</field>
<field name="root_node">
949648</field>
<field name="parent_node">
949707</field>
</data>
</node>
