Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the File-MimeInfo CPAN distribution.

Report information
The Basics
Id: 66841
Status: resolved
Priority: 0/
Queue: File-MimeInfo

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

Bug Information
Severity: (no value)
Broken in: 0.15
Fixed in: (no value)



Subject: Test failures with bleadperl
The test suite is broken since perl 5.13.6, it seems. See http://matrix.cpantesters.org/?dist=File-MimeInfo%200.15;maxver= Regards, Slaven
Git bisect leads us to v5.13.5-11-gfb85c04, also covered in http://rt.perl.org/rt3/Ticket/Display.html?id=78008
Subject: Re: [rt.cpan.org #66841] Test failures with bleadperl
Date: Tue, 29 Mar 2011 22:45:12 +0200
To: bug-File-MimeInfo [...] rt.cpan.org
From: Jaap Karssenberg <jaap.karssenberg [...] gmail.com>
Looks like it is due to regex string representation having changed. Been a while since I worked on this code, so not sure how quick I can fix it, but seems simple enough to make the test a bit more permissive. -- Jaap
Subject: Re: [rt.cpan.org #66841] Test failures with bleadperl
Date: Sun, 03 Apr 2011 17:03:46 +0200
To: bug-File-MimeInfo [...] rt.cpan.org
From: Slaven Rezic <slaven [...] rezic.de>
"Jaap Karssenberg via RT" <bug-File-MimeInfo@rt.cpan.org> writes: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=66841 > > > Looks like it is due to regex string representation having changed. > > Been a while since I worked on this code, so not sure how quick I can fix > it, but seems simple enough to make the test a bit more permissive. >
Allowing both regexp stringifications results in the tests looks like the right approach to me, too. Regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de tktimex - time recording tool http://sourceforge.net/projects/ptktools/
I've attached a simple works-for-me patch that permits the regular expression being any one of a list of possible strings.

This allows this package to Pass Tests on 5.14 release candidates.
Subject: 0001-Suggested-fix-for-RT-66841.patch
From 807262f4aeb0694b6eabcc1acffecfa87e1df783 Mon Sep 17 00:00:00 2001 From: Kent Fredric <kentfredric@gmail.com> Date: Sat, 7 May 2011 09:35:19 +1200 Subject: [PATCH] Suggested fix for RT#66841 Replace regexp validation tests with similar tests that permit it to be any one of a list of values. --- t/01_normal.t | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/t/01_normal.t b/t/01_normal.t index 305da37..08c57f4 100644 --- a/t/01_normal.t +++ b/t/01_normal.t @@ -18,12 +18,23 @@ use_ok('File::MimeInfo', qw/mimetype describe globs/); # 1 # test _glob_to_regexp my $i = 0; -for ( - [ '*.pl', '(?-xism:^.*\.pl$)' ], # 4 - [ '*.h++', '(?-xism:^.*\.h\+\+$)' ], # 5 - [ '*.[tar].*', '(?-xism:^.*\.[tar]\..*$)'], # 6 - [ '*.?', '(?-xism:^.*\..?$)'], # 7 -) { is( File::MimeInfo::_glob_to_regexp($_->[0]), $_->[1], 'glob '.++$i ) } +for my $glob ( + [ '*.pl', [ '(?-xism:^.*\.pl$)', '(?^u:^.*\.pl$)' ] ], # 4 + [ '*.h++', [ '(?-xism:^.*\.h\+\+$)', '(?^u:^.*\.h\+\+$)' ] ], # 5 + [ '*.[tar].*', [ '(?-xism:^.*\.[tar]\..*$)', '(?^u:^.*\.[tar]\..*$)' ] ], # 6 + [ '*.?', [ '(?-xism:^.*\..?$)', '(?^u:^.*\..?$)' ] ], # 7 + ) +{ + my $converted = File::MimeInfo::_glob_to_regexp( $glob->[0] ); + my $number = ++$i; + if ( my ($match) = grep { $_ eq "$converted" } @{ $glob->[1] } ) { + pass( 'glob ' . $number . ' matches an expected value' ); + note explain $match; + next; + } + fail( 'glob ' . $number . ' matches an expected value' ); + diag explain { got => "$converted", expected_one_of => $glob->[1] }; +} # test parsing file names $i = 0; -- 1.7.5.rc3
Thanks for the patch! 5.14 ships with openSUSE 12.1, thus the patch is mandatory for me. using 'note explain' makes it incompatible with SLE11 though; I am commenting out this line.
Will release fix in version 0.16