develooper Front page | | Postings from September 2007

Bug fix in Test::More 0.71 may reveal failures tests

Thread Next
Michael G Schwern
September 15, 2007 05:22
Bug fix in Test::More 0.71 may reveal failures tests
Message ID:
Test::More 0.71 fixed a subtle bug where a call to use_ok() inside a BEGIN
block without a plan would be silently ignored.  That is...

	use Test::More;

	BEGIN { use_ok('Exporter') }  # for example

	plan tests => 1;

would pass when it should have failed.  This commonly takes the form...

	use Test::More;

	if( ...something we need isn't there... ) {
		plan skip_all => "Missing something";
	else {
		plan tests => 2;

	BEGIN { use_ok('Some::Module') }

Even though the use_ok() comes after the plan() in the code, it gets run
before because of the BEGIN block.  If your code does the above, it won't work

This has already effected two modules, and one of them is DBI.

Stabbing you in the face so you don't have to.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About