Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Test-WWW-Mechanize for openSUSE:Factory checked in at 2022-05-12 23:00:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-WWW-Mechanize (Old) and /work/SRC/openSUSE:Factory/.perl-Test-WWW-Mechanize.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-WWW-Mechanize" Thu May 12 23:00:26 2022 rev:12 rq:976460 version:1.58 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-WWW-Mechanize/perl-Test-WWW-Mechanize.changes 2020-12-11 20:16:57.936665851 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Test-WWW-Mechanize.new.1538/perl-Test-WWW-Mechanize.changes 2022-05-12 23:00:52.904838805 +0200 @@ -1,0 +2,26 @@ +Sat Apr 30 03:08:05 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 1.58 + see /usr/share/doc/packages/perl-Test-WWW-Mechanize/Changes + + 1.58 Fri Apr 29 11:23:39 CDT 2022 + ------------------------------------ + [ENHANCEMENTS] + Failed get_ok, post_ok, head_ok, put_ok, delete_ok calls now show the URL + as a diagnostic if there's a problem accessing the URL. This apply to + functions like submit_form_ok() and follow_link_ok() that are wrappers + around these methods. + 1.56 Tue Apr 26 22:14:12 CDT 2022 + ------------------------------------ + This version of Test::WWW::Mechanize requires Perl 5.10. + [ENHANCEMENTS] + Add check_all_images_ok(). (GH #17) Thanks, Julien Fiegehenn. + This is the first version of this function, and its functionality may + change in the near future. + [DOCUMENTATION] + Fixed some incorrect docs. Thanks, Daniel B??hmer. + [INTERNALS] + Require Perl 5.10. + Explicitly requires HTTP::Message 6.29 or higher. + +------------------------------------------------------------------- Old: ---- Test-WWW-Mechanize-1.54.tar.gz New: ---- Test-WWW-Mechanize-1.58.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-WWW-Mechanize.spec ++++++ --- /var/tmp/diff_new_pack.UeYYb6/_old 2022-05-12 23:00:53.448839535 +0200 +++ /var/tmp/diff_new_pack.UeYYb6/_new 2022-05-12 23:00:53.456839546 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-WWW-Mechanize # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,23 +16,22 @@ # +%define cpan_name Test-WWW-Mechanize Name: perl-Test-WWW-Mechanize -Version: 1.54 +Version: 1.58 Release: 0 -%define cpan_name Test-WWW-Mechanize -Summary: Testing-specific WWW::Mechanize subclass License: Artistic-2.0 -Group: Development/Libraries/Perl +Summary: Testing-specific WWW::Mechanize subclass URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Carp::Assert::More) >= 1.16 BuildRequires: perl(HTML::Form) BuildRequires: perl(HTML::TokeParser) +BuildRequires: perl(HTTP::Message) >= 6.29 BuildRequires: perl(HTTP::Server::Simple) >= 0.42 BuildRequires: perl(HTTP::Server::Simple::CGI) BuildRequires: perl(LWP) >= 6.02 @@ -45,6 +44,7 @@ Requires: perl(Carp::Assert::More) >= 1.16 Requires: perl(HTML::Form) Requires: perl(HTML::TokeParser) +Requires: perl(HTTP::Message) >= 6.29 Requires: perl(HTTP::Server::Simple) >= 0.42 Requires: perl(HTTP::Server::Simple::CGI) Requires: perl(LWP) >= 6.02 @@ -60,11 +60,11 @@ Testing-specific WWW::Mechanize subclass %prep -%setup -q -n %{cpan_name}-%{version} +%autosetup -n %{cpan_name}-%{version} %build perl Makefile.PL INSTALLDIRS=vendor -make %{?_smp_mflags} +%make_build %check make test @@ -75,7 +75,6 @@ %perl_gen_filelist %files -f %{name}.files -%defattr(-,root,root,755) %doc Changes README.md %changelog ++++++ Test-WWW-Mechanize-1.54.tar.gz -> Test-WWW-Mechanize-1.58.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/Changes new/Test-WWW-Mechanize-1.58/Changes --- old/Test-WWW-Mechanize-1.54/Changes 2020-12-09 06:25:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/Changes 2022-04-29 18:23:44.000000000 +0200 @@ -5,6 +5,33 @@ https://github.com/petdance/test-www-mechanize/issues +1.58 Fri Apr 29 11:23:39 CDT 2022 +------------------------------------ +[ENHANCEMENTS] +Failed get_ok, post_ok, head_ok, put_ok, delete_ok calls now show the URL +as a diagnostic if there's a problem accessing the URL. This apply to +functions like submit_form_ok() and follow_link_ok() that are wrappers +around these methods. + + +1.56 Tue Apr 26 22:14:12 CDT 2022 +------------------------------------ +This version of Test::WWW::Mechanize requires Perl 5.10. + +[ENHANCEMENTS] +Add check_all_images_ok(). (GH #17) Thanks, Julien Fiegehenn. +This is the first version of this function, and its functionality may +change in the near future. + +[DOCUMENTATION] +Fixed some incorrect docs. Thanks, Daniel B??hmer. + +[INTERNALS] +Require Perl 5.10. + +Explicitly requires HTTP::Message 6.29 or higher. + + 1.54 Tue Dec 8 23:25:06 CST 2020 ------------------------------------ [ENHANCEMENTS] @@ -479,4 +506,3 @@ 0.01 Mon Jun 28 16:38:45 CDT 2004 ------------------------------------ First version, released on an unsuspecting world. - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/META.json new/Test-WWW-Mechanize-1.58/META.json --- old/Test-WWW-Mechanize-1.54/META.json 2020-12-09 06:25:32.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/META.json 2022-04-29 18:24:38.000000000 +0200 @@ -4,13 +4,13 @@ "Andy Lester <a...@petdance.com>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.16, CPAN::Meta::Converter version 2.150005", + "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Test-WWW-Mechanize", "no_index" : { @@ -36,6 +36,7 @@ "Carp::Assert::More" : "1.16", "HTML::Form" : "0", "HTML::TokeParser" : "0", + "HTTP::Message" : "6.29", "HTTP::Server::Simple" : "0.42", "HTTP::Server::Simple::CGI" : "0", "LWP" : "6.02", @@ -45,7 +46,7 @@ "URI::file" : "0", "WWW::Mechanize" : "1.68", "parent" : "0", - "perl" : "5.008" + "perl" : "5.01" } } }, @@ -57,11 +58,8 @@ "homepage" : "https://github.com/petdance/test-www-mechanize", "license" : [ "https://opensource.org/licenses/artistic-license-2.0" - ], - "repository" : { - "url" : "https://github.com/petdance/test-www-mechanize" - } + ] }, - "version" : "1.54", - "x_serialization_backend" : "JSON::PP version 2.27400" + "version" : "1.58", + "x_serialization_backend" : "JSON::PP version 4.04" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/META.yml new/Test-WWW-Mechanize-1.58/META.yml --- old/Test-WWW-Mechanize-1.54/META.yml 2020-12-09 06:25:32.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/META.yml 2022-04-29 18:24:38.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.16, CPAN::Meta::Converter version 2.150005' +generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -22,6 +22,7 @@ Carp::Assert::More: '1.16' HTML::Form: '0' HTML::TokeParser: '0' + HTTP::Message: '6.29' HTTP::Server::Simple: '0.42' HTTP::Server::Simple::CGI: '0' LWP: '6.02' @@ -31,11 +32,10 @@ URI::file: '0' WWW::Mechanize: '1.68' parent: '0' - perl: '5.008' + perl: '5.01' resources: bugtracker: https://github.com/petdance/test-www-mechanize/issues homepage: https://github.com/petdance/test-www-mechanize license: https://opensource.org/licenses/artistic-license-2.0 - repository: https://github.com/petdance/test-www-mechanize -version: '1.54' -x_serialization_backend: 'CPAN::Meta::YAML version 0.012' +version: '1.58' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/Makefile.PL new/Test-WWW-Mechanize-1.58/Makefile.PL --- old/Test-WWW-Mechanize-1.54/Makefile.PL 2020-12-09 06:24:21.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/Makefile.PL 2022-04-27 05:22:44.000000000 +0200 @@ -13,6 +13,7 @@ 'Carp' => 0, 'Carp::Assert::More' => '1.16', 'HTML::Form' => 0, + 'HTTP::Message' => '6.29', 'HTTP::Server::Simple' => '0.42', 'HTTP::Server::Simple::CGI' => 0, 'HTML::TokeParser' => 0, @@ -23,6 +24,7 @@ 'URI::file' => 0, 'WWW::Mechanize' => '1.68', }, + MIN_PERL_VERSION => 5.010, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test-WWW-Mechanize-*' }, }; @@ -37,13 +39,10 @@ license => 'https://opensource.org/licenses/artistic-license-2.0', homepage => 'https://github.com/petdance/test-www-mechanize', bugtracker => 'https://github.com/petdance/test-www-mechanize/issues', - repository => 'https://github.com/petdance/test-www-mechanize', + repository => 'g...@github.com:petdance/test-www-mechanize.git', } }; } -if ( $ExtUtils::MakeMaker::VERSION ge '6.48' ) { - $parms->{MIN_PERL_VERSION} = 5.008; -} my $module = 'HTML::Lint 2.20'; if ( not eval "use $module; 1;" ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/Mechanize.pm new/Test-WWW-Mechanize-1.58/Mechanize.pm --- old/Test-WWW-Mechanize-1.54/Mechanize.pm 2020-12-09 06:24:55.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/Mechanize.pm 2022-04-29 18:23:32.000000000 +0200 @@ -2,6 +2,7 @@ use strict; use warnings; +use 5.010; =head1 NAME @@ -9,11 +10,11 @@ =head1 VERSION -Version 1.54 +Version 1.58 =cut -our $VERSION = '1.54'; +our $VERSION = '1.58'; =head1 SYNOPSIS @@ -66,10 +67,22 @@ use HTML::TokeParser (); use WWW::Mechanize (); -use Test::LongString; +use Test::LongString qw( + contains_string + is_string + lacks_string + like_string + unlike_string +); use Test::Builder (); use Carp (); -use Carp::Assert::More; +use Carp::Assert::More qw( + assert_arrayref + assert_in + assert_is + assert_isa + assert_nonblank +); use parent 'WWW::Mechanize'; @@ -220,10 +233,18 @@ if ( !$emitted_ok ) { $TB->ok( $ok, $desc ); + if ( !$ok ) { + # Only show the URL and not the response message, because the + # problem is with the lint/tidy, not the fetching of the URL. + my $url = $self->_diag_url(); + $TB->diag( $url ) if $url; + } } } else { $TB->ok( $ok, $desc ); + my $url = $self->_diag_url(); + $TB->diag( $url ) if $url; $TB->diag( $self->status ); $TB->diag( $self->response->message ) if $self->response; } @@ -231,6 +252,7 @@ return $ok; } + =head2 $mech->head_ok($url, [ \%LWP_options ,] $desc) A wrapper around WWW::Mechanize's head(), with similar options, except @@ -252,6 +274,8 @@ $TB->ok( $ok, $desc ); if ( !$ok ) { + my $url = $self->_diag_url(); + $TB->diag( $url ) if $url; $TB->diag( $self->status ); $TB->diag( $self->response->message ) if $self->response; } @@ -310,6 +334,8 @@ my $ok = $self->success; $TB->ok( $ok, $desc ); if ( !$ok ) { + my $url = $self->_diag_url(); + $TB->diag( $url ) if $url; $TB->diag( $self->status ); $TB->diag( $self->response->message ) if $self->response; } @@ -1440,7 +1466,7 @@ return @failures; } -# Create an array of urls to match for mech to follow. +# Return a list of URLs to match for Mech to follow. sub _format_links { my $links = shift; @@ -1468,7 +1494,7 @@ =head2 $mech->scrape_text_by_attr( $attr, $attr_regex [, $html ] ) -Returns an array of strings, each string the text surrounded by an +Returns a list of strings, each string the text surrounded by an element with attribute I<$attr> of value I<$value>. You can also pass in a regular expression. If nothing is found the return is an empty list. In scalar context the return is the first string found. @@ -1628,7 +1654,7 @@ } -=head2 id_exists( $id ) +=head2 $mech->id_exists( $id ) Returns TRUE/FALSE if the given ID exists in the given HTML, or if none is provided, then the current page. @@ -1764,7 +1790,8 @@ $TB->plan( tests => scalar @{$ids} ); foreach my $id ( @$ids ) { - $self->lacks_id_ok( $id, "ID '" . ($id // '') . "' should not exist" ); + my $id_disp = defined($id) ? $id : '<undef>'; + $self->lacks_id_ok( $id, "ID '$id_disp' should not exist" ); } } ); @@ -1893,18 +1920,18 @@ =head2 $mech->grep_inputs( \%properties ) -grep_inputs() returns an array of all the input controls in the -current form whose properties match all of the regexes in $properties. +Returns a list of all the input controls in the +current form whose properties match all of the regexes in C<$properties>. The controls returned are all descended from HTML::Form::Input. -If $properties is undef or empty then all inputs will be +If C<$properties> is undef or empty then all inputs will be returned. If there is no current page, there is no form on the current page, or there are no submit controls in the current form -then the return will be an empty array. +then the return will be an empty list. - # get all text controls whose names begin with "customer" + # Get all text controls whose names begin with "customer". my @customer_text_inputs = $mech->grep_inputs( { type => qr/^(text|textarea)$/, @@ -1948,7 +1975,7 @@ return @found; } -# search an array of hashrefs, returning an array of the incoming +# Search an array of hashrefs, returning a list of the incoming # hashrefs that match *all* the pattern in $patterns. sub _grep_hashes { my $hashes = shift; @@ -1957,13 +1984,13 @@ my @found; if ( ! %{$patterns} ) { - # nothing to match on, so return them all + # Nothing to match on, so return them all. @found = @{$hashes}; } else { foreach my $hash ( @{$hashes} ) { - # check every pattern for a match on the current hash + # Check every pattern for a match on the current hash. my $matches_everything = 1; foreach my $pattern_key ( keys %{$patterns} ) { $matches_everything = 0 unless exists $hash->{$pattern_key} && $hash->{$pattern_key} =~ $patterns->{$pattern_key}; @@ -2142,8 +2169,6 @@ and controls that HTML does not allow to be capped (e.g. textarea) are ignored. -The inputs in the returned array are descended from HTML::Form::Input. - The return is true if the test succeeded, false otherwise. =cut @@ -2180,6 +2205,75 @@ return $ok; } +=head2 $mech->check_all_images_ok( [%criterium ], [$comment] ) + +Executes a test to make sure all images in the page can be downloaded. It +does this by running C<HEAD> requests on them. The current page content stays the same. + +The test fails if any image cannot be found, but reports all of the ones that were not found. + +For a definition of I<all images>, see L<< C<images>in WWW::Mechanize|WWW::Mechanize/$mech->images >>. + +The optional C<%criterium> argument can be passed in before the C<$comment> and will be used to define +which images should be considered. This is useful to filter out specific paths. + + $mech->check_all_images_ok( url_regex => qr{^/}, 'All absolute images should exist'); + $mech->check_all_images_ok( url_regex => qr{\.(?:gif|jpg)$}, 'All gif and jpg images should exist'); + $mech->check_all_images_ok( + url_regex => qr{^((?!\Qhttps://googleads.g.doubleclick.net/\E).)*$}, + 'All images should exist, but Ignore the ones from Doubleclick' + ); + +For a full list of possible arguments see L<< C<find_all_images>in WWW::Mechanize|WWW::Mechanize/$mech->find_all_images >>. + +The return is true if the test succeeded, false otherwise. + +=cut + +sub check_all_images_ok { + my $self = shift; + my @args = @_; + + my $comment; + if ( @args % 2 ) { + $comment = pop @args; + } + + $comment = 'All images in the page should exist' unless defined($comment); + + require HTTP::Request::Common; + + my @not_ok; + foreach my $img ( map { $_->URI } $self->find_all_images(@args) ) { + my $abs = $img->abs; + + state $head_cache; # Cache images we've already checked between calls. + if ( !$head_cache->{$abs}++ ) { + # WWW::Mechanize->_make_request makes a raw LWP::UserAgent request that does + # not show up in our history and does not mess with our current content. + my $res = $self->_make_request( HTTP::Request::Common::HEAD($abs) ); + if ( not $res->is_success ) { + push( @not_ok, $img . ' returned code ' . $res->code ); + } + } + } + + my $ok = $TB->ok( @not_ok == 0, $comment ); + $TB->diag($_) for @not_ok; + + return $ok; +} + + +sub _diag_url { + my $self = shift; + + my $uri = $self->uri; + + return $uri ? $uri->as_string : 'Unable to determine URL'; +} + + =head1 TODO Add HTML::Tidy capabilities. @@ -2222,6 +2316,7 @@ =head1 ACKNOWLEDGEMENTS Thanks to +Julien Fiegehenn, @marderh, Eric A. Zarko, @moznion, @@ -2243,7 +2338,7 @@ =head1 COPYRIGHT & LICENSE -Copyright 2004-2020 Andy Lester. +Copyright 2004-2022 Andy Lester. This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License version 2.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/README.md new/Test-WWW-Mechanize-1.58/README.md --- old/Test-WWW-Mechanize-1.54/README.md 2018-03-26 18:22:58.000000000 +0200 +++ new/Test-WWW-Mechanize-1.58/README.md 2022-04-27 05:22:40.000000000 +0200 @@ -1,9 +1,9 @@ # Test-WWW-Mechanize -* Travis: [![Build Status](https://travis-ci.org/petdance/test-www-mechanize.svg?branch=dev)](https://travis-ci.org/petdance/test-www-mechanize) +* Build status: [![Build Status](https://github.com/petdance/test-www-mechanize/workflows/testsuite/badge.svg?branch=dev)](https://github.com/petdance/test-www-mechanize/actions?query=workflow%3Atestsuite+branch%3Adev) * cpantesters.org: [summary](http://www.cpantesters.org/distro/T/Test-WWW-Mechanize.html) and -[dev FAILs](http://www.cpantesters.org/distro/T/Test-WWW-Mechanize.html?grade=3&perlmat=2&patches=2&oncpan=2&distmat=3&perlver=ALL&osname=ALL&version=1.44) +[dev FAILures](http://www.cpantesters.org/distro/T/Test-WWW-Mechanize.html?grade=3&perlmat=2&patches=2&oncpan=2&distmat=3&perlver=ALL&osname=ALL&version=1.44) ---- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/00-load.t new/Test-WWW-Mechanize-1.58/t/00-load.t --- old/Test-WWW-Mechanize-1.54/t/00-load.t 2018-12-05 17:11:02.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/00-load.t 2022-04-27 05:22:40.000000000 +0200 @@ -7,11 +7,16 @@ use LWP; use WWW::Mechanize; +use Test::Builder::Tester; use Test::WWW::Mechanize; pass( 'Modules loaded' ); -diag( "Testing Test::WWW::Mechanize $Test::WWW::Mechanize::VERSION, with WWW::Mechanize $WWW::Mechanize::VERSION, LWP $LWP::VERSION, Test::More $Test::More::VERSION, Perl $], $^X" ); +diag( "Testing Test::WWW::Mechanize $Test::WWW::Mechanize::VERSION undef Perl $], $^X" ); +diag( "LWP $LWP::VERSION" ); +diag( "WWW::Mechanize $WWW::Mechanize::VERSION" ); +diag( "Test::More $Test::More::VERSION" ); +diag( "Test::Builder::Tester $Test::Builder::Tester::VERSION" ); for my $module ( qw( HTML::Lint HTML::Tidy5 ) ) { my $rc = eval "use $module; 1;"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/content_contains.t new/Test-WWW-Mechanize-1.58/t/content_contains.t --- old/Test-WWW-Mechanize-1.54/t/content_contains.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/content_contains.t 2022-04-27 05:22:40.000000000 +0200 @@ -37,11 +37,19 @@ # test failure test_out( 'not ok 1 - Where is Mungo?' ); -test_fail(+5); -test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) ); -test_diag(q( can't find: "Mungo") ); -test_diag(q( LCSS: "go")); -test_diag(q(LCSS context: "dy>\x{0a} <h1>Test Page</h1>\x{0a} <a href="go")); +test_fail(+13); +if ( $^O eq 'MSWin32' ) { + test_diag(q( searched: "<html>\x{0d}\x{0a} <head>\x{0d}\x{0a} <title>Test Page</titl"...) ); + test_diag(q( can't find: "Mungo") ); + test_diag(q( LCSS: "go")); + test_diag(q(LCSS context: ">\x{0d}\x{0a} <h1>Test Page</h1>\x{0d}\x{0a} <a href="go")); +} +else { + test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) ); + test_diag(q( can't find: "Mungo") ); + test_diag(q( LCSS: "go")); + test_diag(q(LCSS context: "dy>\x{0a} <h1>Test Page</h1>\x{0a} <a href="go")); +} $mech->content_contains( 'Mungo', 'Where is Mungo?' ); test_test( 'Handles not finding it' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/content_lacks.t new/Test-WWW-Mechanize-1.58/t/content_lacks.t --- old/Test-WWW-Mechanize-1.54/t/content_lacks.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/content_lacks.t 2022-04-27 05:22:40.000000000 +0200 @@ -26,10 +26,17 @@ test_test( 'Finds the lacks - default desc' ); test_out( q{not ok 1 - Shouldn't say it's a test page} ); -test_fail(+4); -test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) ); -test_diag(q( and found: "Test Page") ); -test_diag(q( at position: 33 (line 3 column 16)) ); +test_fail(+11); +if ( $^O eq 'MSWin32' ) { + test_diag(q( searched: "<html>\x{0d}\x{0a} <head>\x{0d}\x{0a} <title>Test Page</titl"...) ); + test_diag(q( and found: "Test Page") ); + test_diag(q( at position: 35 (line 3 column 16)) ); +} +else { + test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) ); + test_diag(q( and found: "Test Page") ); + test_diag(q( at position: 33 (line 3 column 16)) ); +} $mech->content_lacks( 'Test Page', q{Shouldn't say it's a test page} ); test_test( 'Handles not finding it' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/follow_link_ok.t new/Test-WWW-Mechanize-1.58/t/follow_link_ok.t --- old/Test-WWW-Mechanize-1.54/t/follow_link_ok.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/follow_link_ok.t 2022-04-29 18:20:37.000000000 +0200 @@ -25,12 +25,15 @@ isa_ok( $mech, 'Test::WWW::Mechanize' ); my $uri = URI::file->new_abs( 't/badlinks.html' ); + my $bad_uri = $uri->as_string; + my $path = $uri->file; - $path =~ s{\Qbadlinks.html}{bad1.html}; + s{\Qbadlinks.html}{bad1.html} for ( $path, $bad_uri ); $mech->get_ok( $uri->as_string ); test_out('not ok 1 - Go after bad link'); - test_fail(+3); + test_fail(+4); + test_diag( $bad_uri ); test_diag( 404 ); # XXX Who is printing this 404, and should it be? test_diag( qq{File `$path' does not exist} ); $mech->follow_link_ok( {n=>2}, 'Go after bad link' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/get_ok.t new/Test-WWW-Mechanize-1.58/t/get_ok.t --- old/Test-WWW-Mechanize-1.54/t/get_ok.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/get_ok.t 2022-04-29 18:20:37.000000000 +0200 @@ -35,7 +35,8 @@ ok(!$mech->success, qq{sanity check: we can't load $badurl}); test_out( 'not ok 1 - Try to get bad URL' ); - test_fail( +3 ); + test_fail( +4 ); + test_diag( $badurl ); test_diag( '404' ); test_diag( qq{File `$abs_path' does not exist} ); my $ok = $mech->get_ok( $badurl->as_string, 'Try to get bad URL' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/has_tag.t new/Test-WWW-Mechanize-1.58/t/has_tag.t --- old/Test-WWW-Mechanize-1.54/t/has_tag.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/has_tag.t 2022-04-27 05:22:44.000000000 +0200 @@ -67,6 +67,6 @@ test_out( 'ok 1 - Page has p tag with "Hi"'); $mech->has_tag( 'p', 'Hi' ); -test_test( "Finding text in sub inline element in p" ); +test_test( 'Finding text in sub inline element in p' ); done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/head_ok.t new/Test-WWW-Mechanize-1.58/t/head_ok.t --- old/Test-WWW-Mechanize-1.54/t/head_ok.t 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/head_ok.t 2022-04-29 18:20:37.000000000 +0200 @@ -38,7 +38,8 @@ ok(!$mech->success, qq{sanity check: we can't load $badurl} ); test_out( 'not ok 1 - Try to HEAD bad URL' ); - test_fail( +3 ); + test_fail( +4 ); + test_diag( $badurl->as_string ); test_diag( '404' ); test_diag( qq{File `$abs_path' does not exist} ); my $ok = $mech->head_ok( $badurl->as_string, 'Try to HEAD bad URL' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/lacks_uncapped_inputs-bad.html new/Test-WWW-Mechanize-1.58/t/lacks_uncapped_inputs-bad.html --- old/Test-WWW-Mechanize-1.54/t/lacks_uncapped_inputs-bad.html 2018-03-14 17:46:19.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/lacks_uncapped_inputs-bad.html 2022-04-27 05:22:40.000000000 +0200 @@ -4,12 +4,14 @@ </head> <body> <form name="testform"> - <input name="foo" type="text" size="12"> <!-- this is one bad one with a missin maxlength --> + <input name="foo" type="text" size="12"> <!-- this is one bad one with a missing maxlength --> <input name="bar" type="radio"> <input name="bat" type="text" disabled> <!-- no maxlength, but disabled so it's OK --> <input name="baz" type="text" maxlength=" 14 "> <!-- spaces shouldn't be a problem --> <input name="quux" type="text" size="12" maxlength="dogs"> <!-- not an integer --> <input name="crunchy" type="text" size="12" maxlength="-1"> <!-- negative --> + <input name="bingo" type="text" maxlength=""> <!-- blank --> + <input name="bongo" type="text" maxlength=" "> <!-- all blanks --> </form> </body> </html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.54/t/lacks_uncapped_inputs.t new/Test-WWW-Mechanize-1.58/t/lacks_uncapped_inputs.t --- old/Test-WWW-Mechanize-1.54/t/lacks_uncapped_inputs.t 2020-12-09 06:24:21.000000000 +0100 +++ new/Test-WWW-Mechanize-1.58/t/lacks_uncapped_inputs.t 2022-04-27 05:22:40.000000000 +0200 @@ -26,10 +26,12 @@ $mech->get_ok( $uri ) or die; test_out( 'not ok 1 - This should have three errors found' ); - test_fail( +4 ); + test_fail( +6 ); test_diag( q{foo has no maxlength attribute} ); test_diag( q{quux has an invalid maxlength attribute of "dogs"} ); test_diag( q{crunchy has an invalid maxlength attribute of "-1"} ); + test_diag( q{bingo has an invalid maxlength attribute of ""} ); + test_diag( q{bongo has an invalid maxlength attribute of " "} ); $mech->lacks_uncapped_inputs( 'This should have three errors found' ); test_test( 'Detect uncapped' ); }