Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 25022
Status: resolved
Priority: 0/
Queue: Test-Simple

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

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



Subject: [PATCH] Test using Errno in More.t
If Perl is configured with -Dnoextensions='Text/Soundex' then More.t fails. Attached patch changes More.t to use Errno.pm instead. (I have no use for Text::Soundex, so I build Perl without it.)
Subject: more_t.patch
--- Test-Simple-0.67/t/More.t.orig 2007-02-18 12:16:03.230125000 -0500 +++ Test-Simple-0.67/t/More.t 2007-02-18 12:16:18.902000000 -0500 @@ -15,7 +15,7 @@ $@ = $Err; $! = $Errno; -use_ok('Text::Soundex'); +use_ok('Errno'); require_ok('Test::More');
On Sun Feb 18 12:20:04 2007, JDHEDDEN wrote: Show quoted text
> If Perl is configured with > -Dnoextensions='Text/Soundex' > then More.t fails. > > Attached patch changes More.t to use Errno.pm instead.
No good, its too new. $ corelist Errno Errno was first released with perl 5.008001 I suppose I could use something like Text::ParseWords that's been around since 5.00 and is written in pure Perl so its unlikely to not be installed, but that's what I thought of Text::Soundex and now its in XS! What should really happen is a Dummy module should be placed in t/lib and it should try to load that. Show quoted text
> (I have no use for Text::Soundex, so I build Perl without it.)
I'd say you have a use for it, to test Test::More. ;) I'm sure other modules assume Soundex is available and don't bother listing it as a dependency. Back when I was a Boy Scout we learned how to cut down the weight of our pack. They'd tell stories about people who took this a little too far and would cut the tags off tea bags to save weight. Then they'd scald themselves trying to get the bag out of their hot tea once its brewed. If you still really want to clip this tag off I'm not doing the work. Bring on the patch.
From: JDHEDDEN [...] cpan.org
Show quoted text
> What should really happen is a Dummy module should be placed in t/lib > and it should try to load that.
Thanks for the suggestions. Patch attached.
diff -urN Test-Simple-0.68/MANIFEST Test-Simple-0.68-patched/MANIFEST --- Test-Simple-0.68/MANIFEST 2007-03-13 20:29:28.000000000 -0400 +++ Test-Simple-0.68-patched/MANIFEST 2007-03-14 10:15:50.000000000 -0400 @@ -39,6 +39,7 @@ t/is_fh.t t/lib/NoExporter.pm t/lib/Test/Simple/Catch.pm +t/lib/Test/Simple/Dummy.pm t/lib/Test/Simple/sample_tests/death.plx t/lib/Test/Simple/sample_tests/death_in_eval.plx t/lib/Test/Simple/sample_tests/exit.plx diff -urN Test-Simple-0.68/t/More.t Test-Simple-0.68-patched/t/More.t --- Test-Simple-0.68/t/More.t 2007-03-14 09:32:04.000000000 -0400 +++ Test-Simple-0.68-patched/t/More.t 2007-03-14 10:19:54.000000000 -0400 @@ -3,11 +3,14 @@ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; - @INC = '../lib'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; } } -use Test::More tests => 51; +use Test::More tests => 52; # Make sure we don't mess with $@ or $!. Test at bottom. my $Err = "this should not be touched"; @@ -15,7 +18,8 @@ $@ = $Err; $! = $Errno; -use_ok('Errno'); +use_ok('Test::Simple::Dummy'); +is($Test::Simple::Dummy::VERSION, '0.01', 'Loaded Dummy.pm'); require_ok('Test::More'); diff -urN Test-Simple-0.68/t/lib/Test/Simple/Dummy.pm Test-Simple-0.68-patched/t/lib/Test/Simple/Dummy.pm --- Test-Simple-0.68/t/lib/Test/Simple/Dummy.pm 1969-12-31 19:00:00.000000000 -0500 +++ Test-Simple-0.68-patched/t/lib/Test/Simple/Dummy.pm 2007-03-14 10:20:20.000000000 -0400 @@ -0,0 +1,4 @@ +# For testing use_ok() in t/More.t +package Test::Simple::Dummy; +$VERSION = '0.01'; +1;
On Wed Mar 14 10:24:42 2007, JDHEDDEN wrote: Show quoted text
> > What should really happen is a Dummy module should be placed in t/lib > > and it should try to load that.
> > Thanks for the suggestions. Patch attached.
Sorry, bad patch. It was still using the 'Errno' that I put in earlier. Attached is a patch that really works. (Yes, I actually tested it.)
diff -urN Test-Simple-0.68/MANIFEST Test-Simple-0.68-patched/MANIFEST --- Test-Simple-0.68/MANIFEST 2007-03-13 20:29:28.000000000 -0400 +++ Test-Simple-0.68-patched/MANIFEST 2007-03-14 10:15:50.000000000 -0400 @@ -39,6 +39,7 @@ t/is_fh.t t/lib/NoExporter.pm t/lib/Test/Simple/Catch.pm +t/lib/Test/Simple/Dummy.pm t/lib/Test/Simple/sample_tests/death.plx t/lib/Test/Simple/sample_tests/death_in_eval.plx t/lib/Test/Simple/sample_tests/exit.plx diff -urN Test-Simple-0.68/t/More.t Test-Simple-0.68-patched/t/More.t --- Test-Simple-0.68/t/More.t 2007-03-14 09:32:04.000000000 -0400 +++ Test-Simple-0.68-patched/t/More.t 2007-03-14 10:19:54.000000000 -0400 @@ -3,11 +3,14 @@ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; - @INC = '../lib'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; } } -use Test::More tests => 51; +use Test::More tests => 52; # Make sure we don't mess with $@ or $!. Test at bottom. my $Err = "this should not be touched"; @@ -15,7 +18,8 @@ $@ = $Err; $! = $Errno; -use_ok('Text::Soundex'); +use_ok('Test::Simple::Dummy'); +is($Test::Simple::Dummy::VERSION, '0.01', 'Loaded Dummy.pm'); require_ok('Test::More'); diff -urN Test-Simple-0.68/t/lib/Test/Simple/Dummy.pm Test-Simple-0.68-patched/t/lib/Test/Simple/Dummy.pm --- Test-Simple-0.68/t/lib/Test/Simple/Dummy.pm 1969-12-31 19:00:00.000000000 -0500 +++ Test-Simple-0.68-patched/t/lib/Test/Simple/Dummy.pm 2007-03-14 10:20:20.000000000 -0400 @@ -0,0 +1,4 @@ +# For testing use_ok() in t/More.t +package Test::Simple::Dummy; +$VERSION = '0.01'; +1;
Yep, forgot about this one. I've applied it and it'll be in the next release, thanks.