Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by Anonymous Monk
on Sep 17, 2018 at 15:21 UTC ( [id://1222515]=note: print w/replies, xml ) Need Help??


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

I have counted on this behavior for years. Your question has made me realize that it is, in fact, not documented anywhere obvious. I think I picked up the habit because of the examples given in the Test::More documentation for BAIL_OUT and diag.

Now, Test::More is implemented in terms of Test::Builder, and the latter's documentation does say that all tests return true if the test succeeds and false if it fails. So the de facto answer appears to be "yes, you can." But the paper trail seems to be lacking, so I would say the de jure answer is "no, you can not." Maybe a documentation bug report should be filed?

Replies are listed 'Best First'.
Re^2: Test::More::ok and her ilk
by chromatic (Archbishop) on Sep 17, 2018 at 18:00 UTC

    We wrote those test functions all to return true or false respectively, so that the ok() ... or diag() pattern would work, for example.. It's documented in Test::More (I just checked), but it's not super obvious. I'm sure documentation patches would be welcome.

      My question was poorly made. There is an abundance of test programs and I am interested in the broad group of TAP emitting Perl testing programs. While I think most of the significant/popular modules follow Test::More's behaviour, I have no sound basis to support the thought. That thought is what I'd like to confirm or debunk before starting a project.

      (Update: "No sound basis"--like I don't even know which see much use.)

      I enjoyed your book with Langworth. I didn't care for the antiquing but you two delivered the high quality it was meant to suggest.

      rir

        Oh, I understand what you're asking now.

        I'm not aware of any requirement to follow this model imposed by Test::Builder or Test2, and I'm certain there's no relationship between this behavior and anything emitted as part of TAP.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found