Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I never really understood the point of use_ok(). If a use fails it'll throw an exception. The use_ok() function doesn't seem to add any value to that. Someone please tell me if I'm missing something.
  • I like to have use_ok() give me its answer then let me decide what to do with it. It always sucks to have side effects forced on you. You want to die (although you probably really want to bail_out), but maybe I want to do something else, like tell a pre-commit hook something, try to log an error message, or whatever. If you want to attach extra behaviour, make a use_ok_or_die().

    I have use_ok() duplicated in several test files. That allows me to run just a single test file with those sanity checks. If you're

  • Every module I own (and all my work projects) have this, but explicitly as the first test.

    01_compile.t is responsible for compiling and loading absolutely everything in the distribution (including test support libraries), for running perl -c tests on all included scripts, and for things which loads module trees automatically, also for making sure that the $VERSION's of the modules all match.

    And if any of this fails, it should do a BAIL_OUT.

    All of this runs FIRST, so that all of the rest of the tests can tru