Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: debug output from TODO with Test::More

by haukex (Archbishop)
on Jan 13, 2017 at 19:24 UTC ( [id://1179542]=note: print w/replies, xml ) Need Help??


in reply to Re^2: debug output from TODO with Test::More
in thread debug output from TODO with Test::More

Hi Anonymous,

Why do code all those lines when you can use SKIP?

Well first of all, because I was answering 1nickt's question, which is about TODO tests :-P

Second, SKIP is not the same as TODO. SKIP doesn't run the test at all, whereas TODO runs it, but expects a failure, and reports when the test starts passing. If you use SKIP instead of TODO, you won't automatically get the information about tests that start passing.

Regards,
-- Hauke D

  • Comment on Re^3: debug output from TODO with Test::More

Replies are listed 'Best First'.
Re^4: debug output from TODO with Test::More
by Anonymous Monk on Jan 13, 2017 at 20:45 UTC
    "If you use SKIP instead of TODO, you won't automatically get the information about tests that start passing."

    And there is ZERO value in that. :-) It is not about the tests passing or failing -- it is about why you are or are not running the tests. TODO is pointless, SKIP has the real value.

      And there is ZERO value in that.

      Sorry, you are quite wrong.

      TODO tests are an extremely valuable tool when you are dealing with volatile data. For example: you fetch data by querying an API, and you know it returns bad results under condition X. So you code a workaround for condition X, and you write a TODO test that you expect to fail. When the test begins to pass you get notification because of the TODO, and you remove the workaround for condition X.

      This is a common strategy. The fact that you aren't familiar with it is no reason to be dismissive of other people's experience.

      From the Test::More docs:

      • You don't skip tests which are failing because there's a bug in your program, or for which you don't yet have code written. For that you use TODO.


      • When do I use SKIP vs. TODO?

        If it's something the user might not be able to do, use SKIP. This includes optional modules that aren't installed, running under an OS that doesn't have some feature (like fork() or symlinks), or maybe you need an Internet connection and one isn't available.

        If it's something the programmer hasn't done yet, use TODO. This is for any code you haven't written yet, or bugs you have yet to fix, but want to put tests in your testing script (always a good idea).


      The way forward always starts with a minimal test.
        "TODO tests are an extremely valuable tool when you are dealing with volatile data."

        Hence why you mock the service and provide data that is not volatile.

        "If it's something the programmer hasn't done yet, use TODO."

        Nah, SKIP does that much better. But thanks for your opinion. Meanwhile, the real world calls ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-04-23 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found