Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Exception CPAN distribution.

Report information
The Basics
Id: 61145
Status: rejected
Priority: 0/
Queue: Test-Exception

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.29
Fixed in: (no value)



Subject: Test::Exception doesn't use Exporter to handle its imports.
Test::Exception doesn't use the Exporter library to handle its imports/exports in a standard way. This breaks other test modules that wish to pass !symbol_name to Test::Exception->import. e.g. this should work: use Test::Exception '!lives_and'; but it dies with: plan() doesn't understand !test_and at -e line 1. BEGIN failed--compilation aborted at -e line 1. It would be smarter to have the import method filter out any arguments that look like they are Test::Moreish (e.g. "tests => 1"), and then call export_to_level(). There is already functionality for this in Test::Builder::Module, which indeed is already in Test::Exception's @ISA. I'd be happy to submit a patch, but your META.yml doesn't include a code repository URL.
Subject: Re: [rt.cpan.org #61145] Test::Exception doesn't use Exporter to handle its imports.
Date: Wed, 8 Sep 2010 10:12:41 +0100
To: bug-Test-Exception [...] rt.cpan.org
From: Adrian Howard <adrianh [...] quietstars.com>
Hi Karen, Ta. Known issue. Any patch will have to handle the existing import behaviour too obviously. The repo is at http://github.com/adrianh/test-exception if you want to play :-) Cheers, Adrian On 7 September 2010 23:16, Karen Etheridge via RT < bug-Test-Exception@rt.cpan.org> wrote: Show quoted text
> Tue Sep 07 18:16:35 2010: Request 61145 was acted upon. > Transaction: Ticket created by ETHER > Queue: Test-Exception > Subject: Test::Exception doesn't use Exporter to handle its imports. > Broken in: 0.29 > Severity: Normal > Owner: Nobody > Requestors: ether@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=61145 > > > > Test::Exception doesn't use the Exporter library to handle its > imports/exports in a standard way. This breaks other test modules that > wish to pass !symbol_name to Test::Exception->import. > > e.g. this should work: > > use Test::Exception '!lives_and'; > > but it dies with: > > plan() doesn't understand !test_and at -e line 1. > BEGIN failed--compilation aborted at -e line 1. > > It would be smarter to have the import method filter out any arguments > that look like they are Test::Moreish (e.g. "tests => 1"), and then call > export_to_level(). There is already functionality for this in > Test::Builder::Module, which indeed is already in Test::Exception's @ISA. > > I'd be happy to submit a patch, but your META.yml doesn't include a code > repository URL. > >
-- http://quietstars.com - twitter.com/adrianh - delicious.com/adrianh
Closing as not a bug. Several Test::* modules adopt this behavior, including Test::More itself. If I were to write Test::Exception anew today I would not include this behavior, I would use exporter. However I can't break backcompat and break the existing import behavior. It is possible to write complicated logic to add the functionality without removing the current behavior, but I don't want to write it, and think it is unnecessary. I would however hapily accept a patch that does this if someone else wanted to write it.