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:
- sub ok (lines 317-22) returns the result of calling ok via Test::More->builder.
- 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).
- The new method of Test::Builder returns a singleton Test::Builder object.
- 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, |
In Section
Seekers of Perl Wisdom