Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Test::More fails...

by choroba (Cardinal)
on May 30, 2023 at 08:20 UTC ( [id://11152502]=note: print w/replies, xml ) Need Help??


in reply to Test::More fails...

If you want to compare that two values are the same, use is, not ok, you'll get nicer diagnostics.
is $comp_pass1, 1, 'compare 1';

Regarding use_ok, I prefer not to use it at all, or test it in a test of its own.

Also note that you can also specify

done_testing(1);
instead of planning.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Test::More fails...
by Bod (Parson) on May 30, 2023 at 09:22 UTC

    Thank you.

    I already have use_ok in a test of its own so I don't need it here and will remove it.

    Off to look at is now :)

    UPDATE...it works...
    Thanks choroba - it now works :)

    I changed:
    ok( $comp_pass1 == 1, 'compare 1' ); to is $comp_pass1, 1, 'compare 1';
    use_ok to a simple use AI::Embedding; and
    done_testing(10); and all(!) tests now pass :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-19 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found