Frequently I notice in test suites that authors aren't always checking that their functions have been exported correctly to their namespace. Having a function exported accidentally can wreak havoc if you redefine a function. Below shows one way of testing this, though you will need to customize it to your situation.
use Test::More 'no_plan';
+
use_ok('CGI');
ok(! defined *::param{CODE}, '¶m is not exported to our namespace'
+);
# in another test file, verifying that you can import:
# (though in this example you can run these in one test file)
use_ok('CGI', ':standard') or die;
can_ok(__PACKAGE__, 'param');
+
# or, if you prefer symmetry with the "not exported" test:
+
ok(defined *::param{CODE}, '¶m is exported to namespace');
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.