Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Test::More how come?

by tmharish (Friar)
on Jan 30, 2013 at 17:10 UTC ( #1016105=note: print w/ replies, xml ) Need Help??


in reply to Test::More how come?

Generally STDOUT does not show up with make test

You can use diag or print STDERR :

#!/usr/local/bin/perl use Test::More; print STDERR "4 - 2 = " , ( 4 - 2 ) . "\n"; cmp_ok ( 4 - 2 , '==', 2, "maths works" ); print STDERR "\n"; print STDERR "-2.3 - -0.6 = " . ( -2.3 - -0.6 ) ."\n"; cmp_ok ( -2.3 - -0.6 , '==', -1.7, "maths works" ); done_testing();


Comment on Re: Test::More how come?
Select or Download Code
Replies are listed 'Best First'.
Re^2: Test::More how come?
by sem999 (Initiate) on Jan 30, 2013 at 17:13 UTC
    Sure, but don't you think the second test should PASS? have i made some really simple mistake but just can't see it??

      It'll work if you use eq instead of ==.

        I get it - it's an FP precision thing. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016105]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2015-07-31 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls