Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Test::More::ok and her ilk

by Athanasius (Archbishop)
on Sep 17, 2018 at 03:53 UTC ( [id://1222491]=note: print w/replies, xml ) Need Help??


in reply to Test::More::ok and her ilk

Hello rir,

Looking at the source code for just the ok method in Test::More, version 1.302140:

  1. sub ok (lines 317-22) returns the result of calling ok via Test::More->builder.

  2. Test::More->builder “Returns the Test::Builder object underlying Test::More” (line 1774). This is implemented in Test::Builder::Module: it simply returns Test::Builder->new (lines 171-3).

  3. The new method of Test::Builder returns a singleton Test::Builder object.

  4. So the underlying ok method invoked is Test::Builder->ok (lines 637-98) which explicitly converts its $test argument into a boolean value (line 644):
    sub ok { my( $self, $test, $name ) = @_; ... $test = $test ? 1 : 0; ... return $test; }

Clear? ;-)

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found