<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Ciao a tutti,<br><br>volevo scrivervi per segnalarvi una curiosità riguardo i test, dato che si tratta di un tema che vorrei approfondire il più possibile (Marcos mi ha "cazziato" dicendomi che prima si scrivono i test e poi il codice :-).<br><br>Ho un modulo del tipo<br><br>package Foo;<br>use Moose;<br>sub task{ print "ok\n" }<br>1<br><br>e un test del tipo<br><br>use strict;<br>use Test::More tests =&gt; 2;<br><br>use_ok( 'Foo' ); # primo test ...<br>my $foo = Foo-&gt;new();<br>ok( $foo-&gt;task() , 'il task ha girato' ); # secondo test ...<br><br># ... ma se faccio un prove -l mi dice che hanno girato TRE test !!!!!!!!<br><br>la cosa mi ha parecchio sorpreso, anche perchè l' ho scoperta veramente per caso ( o meglio, per "sfiga" :-)<br><br>infatti se avessi fatto print "occhei\n" al
 posto di print "ok\n" non avrei avuto problemi :-)))) .<br><br>Un saluto a tutti,<br><br>alla prossima pizzata.<br><br><br><br></div>
</div><br>



      </body></html>