Skip Menu |

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

Report information
The Basics
Id: 97738
Status: resolved
Priority: 0/
Queue: URI-Find-Simple

People
Owner: NEILB [...] cpan.org
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.05
Fixed in: 1.06



Subject: Tests fail with URI-Find-20140709
The URI-Find-20140709 stopped translating URIs to canonical form (http://cpansearch.perl.org/src/MSCHWERN/URI-Find-20140709/Changes). This breaks URI-Find-Simple tests: make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # Failed test 'got news.com uri' # at t/find.t line 27. # got: 'http://www.news.com' # expected: 'http://www.news.com/' # Failed test 'got various.com uri' # at t/find.t line 28. # got: 'http://various.com' # expected: 'http://various.com/' # Failed test 'expcted matches new text' # at t/find.t line 43. # got: 'this is a long string with [[ http://www.news.com ]] urls in it in # [[ http://various.com ]] different forms. [[ mailto:tom@jerakeen.org ]]. # Some urls are [[ ftp://not.http.urls/and/have/paths ]]. # ' # expected: 'this is a long string with [[ http://www.news.com/ ]] urls in it in # [[ http://various.com/ ]] different forms. [[ mailto:tom@jerakeen.org ]]. # Some urls are [[ ftp://not.http.urls/and/have/paths ]]. # ' # Failed test 'got news.com uri' # at t/find.t line 49. # got: 'http://weird.com/url/%c3%a9withunicode' # expected: 'http://weird.com/url/%C3%A9withunicode' # Looks like you failed 4 tests of 16. t/find.t .. Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/16 subtests
Thanks for filing this report. Version 1.05 is now making its way onto CPAN. Cheers, Neil
From: ppisar [...] redhat.com
Dne Po 04.srp.2014 08:16:21, ppisar napsal(a): Show quoted text
> The URI-Find-20140709 stopped translating URIs to canonical form > (http://cpansearch.perl.org/src/MSCHWERN/URI-Find-20140709/Changes). > This breaks URI-Find-Simple tests: >
Attached patch fixes the test. -- Petr
Subject: 0001-Do-not-expect-URI-Find-normalizes-URIs.patch
From 06987676750dea3669e1cdcc63894c154e76ea06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Mon, 4 Aug 2014 14:25:16 +0200 Subject: [PATCH] Do not expect URI::Find normalizes URIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit URI-Find-20140709 stopped translating URIs to canonical form (http://cpansearch.perl.org/src/MSCHWERN/URI-Find-20140709/Changes). As URI::Find documentation quotes non-canonical input with non-canonical output, I assume the non-canonical output is expected, so I changed the tests instead of the code. CPAN RT#97738 Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/find.t | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/find.t b/t/find.t index 978740a..1205d94 100644 --- a/t/find.t +++ b/t/find.t @@ -24,8 +24,8 @@ EOF ok(my @list = URI::Find::Simple::list_uris($text), "got list of uris"); is(scalar(@list), 4, "got 4 uris"); -is($list[0], 'http://www.news.com/', "got news.com uri"); -is($list[1], 'http://various.com/', "got various.com uri"); +like($list[0], qr{\Qhttp://www.news.com\E/?}, "got news.com uri"); +like($list[1], qr{\Qhttp://various.com\E/?}, "got various.com uri"); is($list[2], 'mailto:tom@jerakeen.org', "got email address"); is($list[3], 'ftp://not.http.urls/and/have/paths', "got ftp uri"); @@ -34,16 +34,16 @@ ok(my $new_text = URI::Find::Simple::change_uris($text, sub { return "[[ $text ]]"; }), "changed text"); -ok(my $expected = <<EOF, "set expected text string"); -this is a long string with [[ http://www.news.com/ ]] urls in it in -[[ http://various.com/ ]] different forms. [[ mailto:tom\@jerakeen.org ]]. +my $expected = qr{\A\Qthis is a long string with [[ http://www.news.com\E/?\Q ]] urls in it in +[[ http://various.com\E/?\Q ]] different forms. [[ mailto:tom\E\@\Qjerakeen.org ]]. Some urls are [[ ftp://not.http.urls/and/have/paths ]]. -EOF +\E\z}; +ok($expected, "set expected text string"); -is($new_text, $expected, "expcted matches new text"); +like($new_text, $expected, "expcted matches new text"); my $unicode = "This is a unicode string with a http://weird.com/url/\x{e9}withunicode ok"; @list = URI::Find::Simple::list_uris($unicode); is(scalar(@list), 1, "got 1 uri"); -is($list[0], 'http://weird.com/url/%C3%A9withunicode', "got news.com uri"); +like($list[0], qr{\Qhttp://weird.com/url/%\E[cC]\Q3%\E[aA]\Q9withunicode\E}, "got news.com uri"); -- 1.9.3