diff -Nru libtest-www-mechanize-perl-1.54/Changes libtest-www-mechanize-perl-1.58/Changes --- libtest-www-mechanize-perl-1.54/Changes 2020-12-09 05:25:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/Changes 2022-04-29 16:23:44.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/debian/changelog libtest-www-mechanize-perl-1.58/debian/changelog --- libtest-www-mechanize-perl-1.54/debian/changelog 2020-12-13 01:29:58.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/changelog 2022-05-25 14:33:39.000000000 +0000 @@ -1,3 +1,28 @@ +libtest-www-mechanize-perl (1.58-1) unstable; urgency=medium + + * Team upload. + + [ Debian Janitor ] + * Remove constraints unnecessary since stretch: + + Build-Depends-Indep: Drop versioned constraint on + libcarp-assert-more-perl. + * Remove constraints unnecessary since buster + * libtest-www-mechanize-perl: Drop versioned constraint on + libcarp-assert-more-perl in Depends. + + [ gregor herrmann ] + * Import upstream version 1.58. + * Update (build) dependencies. + * Update years of upstream and packaging copyright. + * Declare compliance with Debian Policy 4.6.0. + * Refresh lintian overrides. + + [ Étienne Mollier ] + * add unwarn-longstring.patch: fix warning during module import. + * d/control: declare compliance to standards version 4.6.1. + + -- Étienne Mollier Wed, 25 May 2022 16:33:39 +0200 + libtest-www-mechanize-perl (1.54-1) unstable; urgency=medium [ Debian Janitor ] diff -Nru libtest-www-mechanize-perl-1.54/debian/control libtest-www-mechanize-perl-1.58/debian/control --- libtest-www-mechanize-perl-1.54/debian/control 2020-12-13 01:29:58.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/control 2022-05-25 14:33:39.000000000 +0000 @@ -8,11 +8,12 @@ Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper-compat (= 13) -Build-Depends-Indep: libcarp-assert-more-perl (>= 1.16) , +Build-Depends-Indep: libcarp-assert-more-perl , libcgi-pm-perl , libhtml-form-perl , libhtml-lint-perl , libhtml-parser-perl , + libhttp-message-perl (>= 6.29) , libhttp-server-simple-perl , libtest-longstring-perl , libtest-pod-coverage-perl , @@ -22,7 +23,7 @@ libwww-perl , netbase , perl -Standards-Version: 4.5.1 +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libtest-www-mechanize-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libtest-www-mechanize-perl.git Homepage: https://metacpan.org/release/Test-WWW-Mechanize @@ -32,9 +33,10 @@ Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, - libcarp-assert-more-perl (>= 1.16), + libcarp-assert-more-perl, libhtml-form-perl, libhtml-parser-perl, + libhttp-message-perl (>= 6.29), libhttp-server-simple-perl, libtest-longstring-perl, liburi-perl, diff -Nru libtest-www-mechanize-perl-1.54/debian/copyright libtest-www-mechanize-perl-1.58/debian/copyright --- libtest-www-mechanize-perl-1.54/debian/copyright 2020-12-13 01:29:58.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/copyright 2022-05-25 14:33:39.000000000 +0000 @@ -4,12 +4,12 @@ Source: https://metacpan.org/release/Test-WWW-Mechanize Files: * -Copyright: 2004-2020, Andy Lester +Copyright: 2004-2022, Andy Lester License: Artistic or GPL-1+ Files: debian/* Copyright: 2006-2007, Krzysztof Krzyzaniak (eloy) - 2006-2020, gregor herrmann + 2006-2022, gregor herrmann 2007, Damyan Ivanov 2007, David Paleino 2008, Ansgar Burchardt diff -Nru libtest-www-mechanize-perl-1.54/debian/libtest-www-mechanize-perl.lintian-overrides libtest-www-mechanize-perl-1.58/debian/libtest-www-mechanize-perl.lintian-overrides --- libtest-www-mechanize-perl-1.54/debian/libtest-www-mechanize-perl.lintian-overrides 2020-12-13 01:29:58.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/libtest-www-mechanize-perl.lintian-overrides 2022-05-25 14:33:39.000000000 +0000 @@ -1 +1,6 @@ -libtest-www-mechanize-perl: typo-in-manual-page usr/share/man/man3/Test::WWW::Mechanize.3pm.gz "allow to" "allow one to" +# this is a false positive: +# "... and controls that HTML does not allow to be capped..." +libtest-www-mechanize-perl: typo-in-manual-page usr/share/man/man3/Test::WWW::Mechanize.3pm.gz line * "allow to" "allow one to" + +# well, yes +libtest-www-mechanize-perl: spelling-in-override-comment typo-in-manual-page (line 2) "allow to" "allow one to" diff -Nru libtest-www-mechanize-perl-1.54/debian/patches/series libtest-www-mechanize-perl-1.58/debian/patches/series --- libtest-www-mechanize-perl-1.54/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/patches/series 2022-05-25 14:33:39.000000000 +0000 @@ -0,0 +1 @@ +unwarn-longstring.patch diff -Nru libtest-www-mechanize-perl-1.54/debian/patches/unwarn-longstring.patch libtest-www-mechanize-perl-1.58/debian/patches/unwarn-longstring.patch --- libtest-www-mechanize-perl-1.54/debian/patches/unwarn-longstring.patch 1970-01-01 00:00:00.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/debian/patches/unwarn-longstring.patch 2022-05-25 14:33:39.000000000 +0000 @@ -0,0 +1,25 @@ +Description: fix warning during module import + Test::WWW::Mechanize looks to make use of Test::LongString in a way the latter + does not seem to have been designed for. +Author: Étienne Mollier +Forwarded: https://github.com/petdance/test-www-mechanize/issues/80 +Last-Update: 2022-05-25 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- libtest-www-mechanize-perl.orig/Mechanize.pm ++++ libtest-www-mechanize-perl/Mechanize.pm +@@ -67,13 +67,7 @@ + + use HTML::TokeParser (); + use WWW::Mechanize (); +-use Test::LongString qw( +- contains_string +- is_string +- lacks_string +- like_string +- unlike_string +-); ++use Test::LongString; + use Test::Builder (); + use Carp (); + use Carp::Assert::More qw( diff -Nru libtest-www-mechanize-perl-1.54/Makefile.PL libtest-www-mechanize-perl-1.58/Makefile.PL --- libtest-www-mechanize-perl-1.54/Makefile.PL 2020-12-09 05:24:21.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/Makefile.PL 2022-04-27 03:22:44.000000000 +0000 @@ -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 => 'git@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 -Nru libtest-www-mechanize-perl-1.54/Mechanize.pm libtest-www-mechanize-perl-1.58/Mechanize.pm --- libtest-www-mechanize-perl-1.54/Mechanize.pm 2020-12-09 05:24:55.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/Mechanize.pm 2022-04-29 16:23:32.000000000 +0000 @@ -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 : ''; + $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 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, see L<< Cin 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<< Cin 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 -Nru libtest-www-mechanize-perl-1.54/META.json libtest-www-mechanize-perl-1.58/META.json --- libtest-www-mechanize-perl-1.54/META.json 2020-12-09 05:25:32.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/META.json 2022-04-29 16:24:38.000000000 +0000 @@ -4,13 +4,13 @@ "Andy Lester " ], "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 -Nru libtest-www-mechanize-perl-1.54/META.yml libtest-www-mechanize-perl-1.58/META.yml --- libtest-www-mechanize-perl-1.54/META.yml 2020-12-09 05:25:32.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/META.yml 2022-04-29 16:24:38.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/README.md libtest-www-mechanize-perl-1.58/README.md --- libtest-www-mechanize-perl-1.54/README.md 2018-03-26 16:22:58.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/README.md 2022-04-27 03:22:40.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/00-load.t libtest-www-mechanize-perl-1.58/t/00-load.t --- libtest-www-mechanize-perl-1.54/t/00-load.t 2018-12-05 16:11:02.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/00-load.t 2022-04-27 03:22:40.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/content_contains.t libtest-www-mechanize-perl-1.58/t/content_contains.t --- libtest-www-mechanize-perl-1.54/t/content_contains.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/content_contains.t 2022-04-27 03:22:40.000000000 +0000 @@ -37,11 +37,19 @@ # test failure test_out( 'not ok 1 - Where is Mungo?' ); -test_fail(+5); -test_diag(q( searched: "\x{0a} \x{0a} Test Page"...) ); -test_diag(q( can't find: "Mungo") ); -test_diag(q( LCSS: "go")); -test_diag(q(LCSS context: "dy>\x{0a}

Test Page

\x{0a} \x{0d}\x{0a} \x{0d}\x{0a} 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"...) ); + test_diag(q( can't find: "Mungo") ); + test_diag(q( LCSS: "go")); + test_diag(q(LCSS context: "dy>\x{0a}

Test Page

\x{0a}
content_contains( 'Mungo', 'Where is Mungo?' ); test_test( 'Handles not finding it' ); diff -Nru libtest-www-mechanize-perl-1.54/t/content_lacks.t libtest-www-mechanize-perl-1.58/t/content_lacks.t --- libtest-www-mechanize-perl-1.54/t/content_lacks.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/content_lacks.t 2022-04-27 03:22:40.000000000 +0000 @@ -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: "\x{0a} \x{0a} Test Page"...) ); -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: "\x{0d}\x{0a} \x{0d}\x{0a} 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"...) ); + 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 -Nru libtest-www-mechanize-perl-1.54/t/follow_link_ok.t libtest-www-mechanize-perl-1.58/t/follow_link_ok.t --- libtest-www-mechanize-perl-1.54/t/follow_link_ok.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/follow_link_ok.t 2022-04-29 16:20:37.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/get_ok.t libtest-www-mechanize-perl-1.58/t/get_ok.t --- libtest-www-mechanize-perl-1.54/t/get_ok.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/get_ok.t 2022-04-29 16:20:37.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/has_tag.t libtest-www-mechanize-perl-1.58/t/has_tag.t --- libtest-www-mechanize-perl-1.54/t/has_tag.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/has_tag.t 2022-04-27 03:22:44.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/head_ok.t libtest-www-mechanize-perl-1.58/t/head_ok.t --- libtest-www-mechanize-perl-1.54/t/head_ok.t 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/head_ok.t 2022-04-29 16:20:37.000000000 +0000 @@ -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 -Nru libtest-www-mechanize-perl-1.54/t/lacks_uncapped_inputs-bad.html libtest-www-mechanize-perl-1.58/t/lacks_uncapped_inputs-bad.html --- libtest-www-mechanize-perl-1.54/t/lacks_uncapped_inputs-bad.html 2018-03-14 16:46:19.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/lacks_uncapped_inputs-bad.html 2022-04-27 03:22:40.000000000 +0000 @@ -4,12 +4,14 @@
- + + +
diff -Nru libtest-www-mechanize-perl-1.54/t/lacks_uncapped_inputs.t libtest-www-mechanize-perl-1.58/t/lacks_uncapped_inputs.t --- libtest-www-mechanize-perl-1.54/t/lacks_uncapped_inputs.t 2020-12-09 05:24:21.000000000 +0000 +++ libtest-www-mechanize-perl-1.58/t/lacks_uncapped_inputs.t 2022-04-27 03:22:40.000000000 +0000 @@ -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' ); }