Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 272321 Details for
Bug 364501
<dev-perl/File-MimeInfo-0.160.0 fails tests Perl 5.14
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Suggested solution for RT#66841
0001-Suggested-fix-for-RT-66841.patch (text/plain), 1.66 KB, created by
Kent Fredric (IRC: kent\n) (RETIRED)
on 2011-05-06 22:03:07 UTC
(
hide
)
Description:
Suggested solution for RT#66841
Filename:
MIME Type:
Creator:
Kent Fredric (IRC: kent\n) (RETIRED)
Created:
2011-05-06 22:03:07 UTC
Size:
1.66 KB
patch
obsolete
>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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 364501
:
270887
| 272321