Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
I can't tell you how many times I get tired of mysterious test behavior because someone forgot to put an 'or die' at the end of a use_ok() test. With this vim function, typing ',use' will convert all 'use_ok $package;' to have an 'or die' at the end.
map
,use :call UseOrDie()<cr>
function! UseOrDie()
%s/^\(\s*use_ok\s*(\?['"].*['"])\?\)\s*;/\1 or die;/
endfunction
For those not familiar with the problem, let's say you have 300 tests in one
map
,use :call UseOrDie()<cr>
function! UseOrDie()
%s/^\(\s*\(use\|require\)_ok\s*(\?['"].*['"])\?\)\s*;/\2 or die;/
endfunction
Why use use_ok, require_ok at all? (Score:2)
Ilya Martynov (http://martynov.org/ [martynov.org])
Re: (Score:1)
Agreed.
Another approach... (Score:1)
That way I get a full report on load failures, and the rest of the tests can totally ignore the issue and load normally.
Re: (Score:2)
That's what I've done with Test::Harness [cpan.org], but this isn't my code base.
Re: (Score:1)
And I believe we already have a test file that loads all modules, but I'm not 100% certain (well, you shouldn't trust anything I say today anyway 8^)