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-12-13 18:57:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-WWW-Mechanize (Old) and /work/SRC/openSUSE:Factory/.perl-Test-WWW-Mechanize.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-WWW-Mechanize" Tue Dec 13 18:57:22 2022 rev:13 rq:1042726 version:1.60 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-WWW-Mechanize/perl-Test-WWW-Mechanize.changes 2022-05-12 23:00:52.904838805 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-WWW-Mechanize.new.1835/perl-Test-WWW-Mechanize.changes 2022-12-13 18:57:45.535937071 +0100 @@ -1,0 +2,20 @@ +Tue Dec 6 03:07:39 UTC 2022 - Tina Müller <timueller+p...@suse.de> + +- updated to 1.60 + see /usr/share/doc/packages/perl-Test-WWW-Mechanize/Changes + + 1.60 Sun Dec 4 10:18:28 PM CST 2022 + ------------------------------------ + [ENHANCMENTS] + Added default test messages for button_exists_ok and lacks_button_ok + methods. Thanks, Daniel Böhmer (GH#70) + get_ok(), post_ok(), head_ok(), put_ok() and delete_ok() now all fail + if an undef URL is passed, rather than passing the undef URL into the + underlying LWP functions. Thanks, Jess Robinson. (GH #40) + [FIXES] + Disable proxies in some of the tests that look at a local test server. + (GH#55, GH#74) + [DOCUMENTATION] + Clarified some wording. Thanks, Daniel Böhmer (GH#70) + +------------------------------------------------------------------- Old: ---- Test-WWW-Mechanize-1.58.tar.gz New: ---- Test-WWW-Mechanize-1.60.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-WWW-Mechanize.spec ++++++ --- /var/tmp/diff_new_pack.fxTLaN/_old 2022-12-13 18:57:45.991939504 +0100 +++ /var/tmp/diff_new_pack.fxTLaN/_new 2022-12-13 18:57:45.995939526 +0100 @@ -18,7 +18,7 @@ %define cpan_name Test-WWW-Mechanize Name: perl-Test-WWW-Mechanize -Version: 1.58 +Version: 1.60 Release: 0 License: Artistic-2.0 Summary: Testing-specific WWW::Mechanize subclass @@ -45,13 +45,8 @@ 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 -Requires: perl(Test::Builder::Tester) >= 1.09 Requires: perl(Test::LongString) >= 0.15 -Requires: perl(Test::More) >= 0.96 -Requires: perl(URI::file) Requires: perl(WWW::Mechanize) >= 1.68 Requires: perl(parent) %{perl_requires} ++++++ Test-WWW-Mechanize-1.58.tar.gz -> Test-WWW-Mechanize-1.60.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/Changes new/Test-WWW-Mechanize-1.60/Changes --- old/Test-WWW-Mechanize-1.58/Changes 2022-04-29 18:23:44.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/Changes 2022-12-05 05:19:45.000000000 +0100 @@ -5,6 +5,24 @@ https://github.com/petdance/test-www-mechanize/issues +1.60 Sun Dec 4 10:18:28 PM CST 2022 +------------------------------------ +[ENHANCMENTS] +Added default test messages for button_exists_ok and lacks_button_ok +methods. Thanks, Daniel Böhmer (GH#70) + +get_ok(), post_ok(), head_ok(), put_ok() and delete_ok() now all fail +if an undef URL is passed, rather than passing the undef URL into the +underlying LWP functions. Thanks, Jess Robinson. (GH #40) + +[FIXES] +Disable proxies in some of the tests that look at a local test server. +(GH#55, GH#74) + +[DOCUMENTATION] +Clarified some wording. Thanks, Daniel Böhmer (GH#70) + + 1.58 Fri Apr 29 11:23:39 CDT 2022 ------------------------------------ [ENHANCEMENTS] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/MANIFEST new/Test-WWW-Mechanize-1.60/MANIFEST --- old/Test-WWW-Mechanize-1.58/MANIFEST 2022-04-29 18:24:38.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/MANIFEST 2022-12-05 05:19:55.000000000 +0100 @@ -43,6 +43,7 @@ t/page_links_ok.t t/pod-coverage.t t/pod.t +t/post_ok.t t/put_ok.t t/scrape_text_by_id.t t/stuff_inputs.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/META.json new/Test-WWW-Mechanize-1.60/META.json --- old/Test-WWW-Mechanize-1.58/META.json 2022-04-29 18:24:38.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/META.json 2022-12-05 05:19:55.000000000 +0100 @@ -4,13 +4,13 @@ "Andy Lester <a...@petdance.com>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.143240", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : 2 + "version" : "2" }, "name" : "Test-WWW-Mechanize", "no_index" : { @@ -37,16 +37,21 @@ "HTML::Form" : "0", "HTML::TokeParser" : "0", "HTTP::Message" : "6.29", - "HTTP::Server::Simple" : "0.42", - "HTTP::Server::Simple::CGI" : "0", "LWP" : "6.02", - "Test::Builder::Tester" : "1.09", + "Test::Builder" : "0", "Test::LongString" : "0.15", - "Test::More" : "0.96", - "URI::file" : "0", "WWW::Mechanize" : "1.68", "parent" : "0", - "perl" : "5.01" + "perl" : "5.010" + } + }, + "test" : { + "requires" : { + "HTTP::Server::Simple" : "0.42", + "HTTP::Server::Simple::CGI" : "0", + "Test::Builder::Tester" : "1.09", + "Test::More" : "0.96", + "URI::file" : "0" } } }, @@ -58,8 +63,10 @@ "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.58", - "x_serialization_backend" : "JSON::PP version 4.04" + "version" : "1.60" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/META.yml new/Test-WWW-Mechanize-1.60/META.yml --- old/Test-WWW-Mechanize-1.58/META.yml 2022-04-29 18:24:38.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/META.yml 2022-12-05 05:19:55.000000000 +0100 @@ -4,10 +4,15 @@ - 'Andy Lester <a...@petdance.com>' build_requires: ExtUtils::MakeMaker: '0' + HTTP::Server::Simple: '0.42' + HTTP::Server::Simple::CGI: '0' + Test::Builder::Tester: '1.09' + Test::More: '0.96' + URI::file: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.143240' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -23,19 +28,15 @@ HTML::Form: '0' HTML::TokeParser: '0' HTTP::Message: '6.29' - HTTP::Server::Simple: '0.42' - HTTP::Server::Simple::CGI: '0' LWP: '6.02' - Test::Builder::Tester: '1.09' + Test::Builder: '0' Test::LongString: '0.15' - Test::More: '0.96' - URI::file: '0' WWW::Mechanize: '1.68' parent: '0' - perl: '5.01' + perl: '5.010' 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 -version: '1.58' -x_serialization_backend: 'CPAN::Meta::YAML version 0.018' + repository: https://github.com/petdance/test-www-mechanize +version: '1.60' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/Makefile.PL new/Test-WWW-Mechanize-1.60/Makefile.PL --- old/Test-WWW-Mechanize-1.58/Makefile.PL 2022-04-27 05:22:44.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/Makefile.PL 2022-12-05 05:19:45.000000000 +0100 @@ -8,38 +8,61 @@ VERSION_FROM => 'Mechanize.pm', ABSTRACT_FROM => 'Mechanize.pm', PL_FILES => {}, - PREREQ_PM => { - 'parent' => 0, + PREREQ_PM => { 'Carp' => 0, 'Carp::Assert::More' => '1.16', 'HTML::Form' => 0, + 'HTML::TokeParser' => 0, 'HTTP::Message' => '6.29', + 'LWP' => '6.02', + 'Test::Builder' => 0, + 'Test::LongString' => '0.15', + 'WWW::Mechanize' => '1.68', + 'parent' => 0, + }, + TEST_REQUIRES => { 'HTTP::Server::Simple' => '0.42', 'HTTP::Server::Simple::CGI' => 0, - 'HTML::TokeParser' => 0, - 'LWP' => 6.02, 'Test::Builder::Tester' => '1.09', - 'Test::LongString' => '0.15', 'Test::More' => '0.96', # subtest() and done_testing() 'URI::file' => 0, - 'WWW::Mechanize' => '1.68', }, MIN_PERL_VERSION => 5.010, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test-WWW-Mechanize-*' }, }; -if ( $ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/ and $ExtUtils::MakeMaker::VERSION > 6.30 ) { +my $eumm_version = $ExtUtils::MakeMaker::VERSION; +$eumm_version =~ tr/_//d; + +# TEST_REQUIRES is not supported in EUMM <= 6.63_03, so collapse the test +# prereqs into the build prereqs. +if ( $eumm_version <= 6.63_03 ) { + $parms->{BUILD_REQUIRES} = { + %{ $parms->{BUILD_REQUIRES} }, + %{ delete $parms->{TEST_REQUIRES} || {} }, + }; +} +# BUILD_REQUIRES is not supported in EUMM <= 6.55_01, so collapse the build +# preereqs into the standard prereqs. +if ( $eumm_version <= 6.63_03 ) { + $parms->{PREPREQ_PM} = { + %{ $parms->{PREPREQ_PM} }, + %{ delete $parms->{BUILD_REQUIRES} || {} }, + }; +} + +if ( $eumm_version > 6.30 ) { $parms->{LICENSE} = 'artistic_2'; } -if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) { +if ( $eumm_version >= 6.46 ) { $parms->{META_MERGE} = { resources => { 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 => 'g...@github.com:petdance/test-www-mechanize.git', + repository => 'https://github.com/petdance/test-www-mechanize', } }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/Mechanize.pm new/Test-WWW-Mechanize-1.60/Mechanize.pm --- old/Test-WWW-Mechanize-1.58/Mechanize.pm 2022-04-29 18:23:32.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/Mechanize.pm 2022-12-05 05:19:45.000000000 +0100 @@ -10,11 +10,11 @@ =head1 VERSION -Version 1.58 +Version 1.60 =cut -our $VERSION = '1.58'; +our $VERSION = '1.60'; =head1 SYNOPSIS @@ -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( @@ -189,6 +183,12 @@ my ($url,$desc,%opts) = $self->_unpack_args( 'GET', @_ ); + if ( !defined($url) ) { + my $ok = $TB->ok( 0, $desc ); + $TB->diag( 'URL cannot be undef.' ); + return $ok; + } + $self->get( $url, %opts ); my $ok = $self->success; @@ -269,6 +269,12 @@ my ($url,$desc,%opts) = $self->_unpack_args( 'HEAD', @_ ); + if ( !defined($url) ) { + my $ok = $TB->ok( 0, $desc ); + $TB->diag( 'URL cannot be undef.' ); + return $ok; + } + $self->head( $url, %opts ); my $ok = $self->success; @@ -306,6 +312,12 @@ my ($url,$desc,%opts) = $self->_unpack_args( 'POST', @_ ); + if ( !defined($url) ) { + my $ok = $TB->ok( 0, $desc ); + $TB->diag( 'URL cannot be undef.' ); + return $ok; + } + $self->post( $url, \%opts ); my $ok = $self->success; $ok = $self->_post_load_validation( $ok, $desc ); @@ -328,6 +340,13 @@ my $self = shift; my ($url,$desc,%opts) = $self->_unpack_args( 'PUT', @_ ); + + if ( !defined($url) ) { + my $ok = $TB->ok( 0, $desc ); + $TB->diag( 'URL cannot be undef.' ); + return $ok; + } + $opts{content} = '' if !exists $opts{content}; $self->put( $url, %opts ); @@ -359,6 +378,12 @@ my ($url,$desc,%opts) = $self->_unpack_args( 'DELETE', @_ ); + if ( !defined($url) ) { + my $ok = $TB->ok( 0, $desc ); + $TB->diag( 'URL cannot be undef.' ); + return $ok; + } + if ($self->can('delete')) { $self->delete( $url, %opts ); } @@ -470,7 +495,7 @@ Carp::croak 'FATAL: parameters must be given as a hashref'; } - # return from follow_link() is an HTTP::Response or undef + # The return from follow_link() is an HTTP::Response or undef. my $response = $self->follow_link( %{$parms} ); my $ok = $response && $response->is_success; @@ -1800,7 +1825,7 @@ =head2 $mech->button_exists( $button ) -Returns a boolean saying whether the submit C<$button> exists. Does not +Returns a boolean saying whether a submit button with the name C<$button> exists. Does not do a test. For that you want C<button_exists_ok> or C<lacks_button_ok>. =cut @@ -1829,7 +1854,7 @@ my $self = shift; my $button = shift; - my $msg = shift; + my $msg = shift || qq{Button named "$button" exists}; return $TB->ok( $self->button_exists( $button ), $msg ); } @@ -1837,7 +1862,7 @@ =head2 $mech->lacks_button_ok( $button [, $msg] ) -Asserts that the button exists on the page. +Asserts that no button named C<$button> exists on the page. =cut @@ -1846,7 +1871,7 @@ my $self = shift; my $button = shift; - my $msg = shift; + my $msg = shift || qq{No button named "$button" exists}; return $TB->ok( !$self->button_exists( $button ), $msg ); } @@ -2067,13 +2092,13 @@ assert_isa( $options, 'HASH' ); assert_in( $_, ['ignore', 'fill', 'specs'] ) foreach ( keys %{$options} ); - # set up the fill we'll use unless a field overrides it + # Set up the fill we'll use unless a field overrides it. my $default_fill = '@'; - if ( exists $options->{fill} && defined $options->{fill} && length($options->{fill}) > 0 ) { + if ( defined $options->{fill} && length($options->{fill}) > 0 ) { $default_fill = $options->{fill}; } - # fields in the form to not stuff + # Fields in the form to not stuff my $ignore = {}; if ( exists $options->{ignore} ) { assert_isa( $options->{ignore}, 'ARRAY' ); @@ -2098,10 +2123,10 @@ my $name = $field->name(); - # skip if it's one of the fields to ignore + # Skip if it's one of the fields to ignore. next if exists $ignore->{ $name }; - # fields with no maxlength will get this many characters + # Fields with no maxlength will get this many characters. my $maxlength = 66000; # maxlength from the HTML @@ -2115,7 +2140,7 @@ my $fill = $default_fill; if ( exists $specs->{$name} ) { - # process the per-field info + # Process the per-field info. if ( exists $specs->{$name}->{fill} && defined $specs->{$name}->{fill} && length($specs->{$name}->{fill}) > 0 ) { $fill = $specs->{$name}->{fill}; @@ -2130,11 +2155,9 @@ # stuff it if ( ($maxlength % length($fill)) == 0 ) { - # the simple case $field->value( $fill x ($maxlength/length($fill)) ); } else { - # can be improved later $field->value( substr( $fill x int(($maxlength + length($fill) - 1)/length($fill)), 0, $maxlength ) ); } } # for @inputs @@ -2276,8 +2299,6 @@ =head1 TODO -Add HTML::Tidy capabilities. - Other ideas for features are at https://github.com/petdance/test-www-mechanize =head1 AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/00-load.t new/Test-WWW-Mechanize-1.60/t/00-load.t --- old/Test-WWW-Mechanize-1.58/t/00-load.t 2022-04-27 05:22:40.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/t/00-load.t 2022-12-05 05:19:45.000000000 +0100 @@ -12,7 +12,7 @@ pass( 'Modules loaded' ); -diag( "Testing Test::WWW::Mechanize $Test::WWW::Mechanize::VERSION undef Perl $], $^X" ); +diag( "Testing Test::WWW::Mechanize $Test::WWW::Mechanize::VERSION on Perl $], $^X" ); diag( "LWP $LWP::VERSION" ); diag( "WWW::Mechanize $WWW::Mechanize::VERSION" ); diag( "Test::More $Test::More::VERSION" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/click_ok.t new/Test-WWW-Mechanize-1.60/t/click_ok.t --- old/Test-WWW-Mechanize-1.58/t/click_ok.t 2020-12-22 05:08:18.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/click_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -15,6 +15,8 @@ my $server_root = $server->root; SUBMIT_GOOD_FORM: { + local @ENV{qw( http_proxy HTTP_PROXY )}; + my $mech = Test::WWW::Mechanize->new(); isa_ok( $mech,'Test::WWW::Mechanize' ); @@ -23,7 +25,10 @@ # XXX We need to check that the request is correct. } + SUBMIT_GOOD_FORM_WITH_COORDINATES: { + local @ENV{qw( http_proxy HTTP_PROXY )}; + my $mech = Test::WWW::Mechanize->new(); isa_ok( $mech,'Test::WWW::Mechanize' ); @@ -35,3 +40,5 @@ $server->stop; done_testing(); + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/delete_ok.t new/Test-WWW-Mechanize-1.60/t/delete_ok.t --- old/Test-WWW-Mechanize-1.58/t/delete_ok.t 2020-12-22 05:08:18.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/delete_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 9; +use Test::More tests => 10; use Test::Builder::Tester; use Test::WWW::Mechanize (); @@ -15,10 +15,12 @@ my $pid = $server->background; my $server_root = $server->root; -my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); -isa_ok($mech,'Test::WWW::Mechanize'); - GOOD_DELETE: { + local @ENV{qw( http_proxy HTTP_PROXY )}; + + my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); + isa_ok($mech,'Test::WWW::Mechanize'); + my $scratch = "$server_root/scratch.html"; $mech->delete_ok($scratch); @@ -46,6 +48,22 @@ *Test::WWW::Mechanize::can = *UNIVERSAL::can{CODE}; } + +UNDEF_URL: { + my $mech = Test::WWW::Mechanize->new(); + + test_out( 'not ok 1 - Passing undef for a URL' ); + test_fail( +2 ); + test_diag( 'URL cannot be undef.' ); + my $ok = $mech->delete_ok( undef, 'Passing undef for a URL' ); + test_test( 'Undef URLs' ); +} + + + $server->stop; done_testing(); + + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/get_ok.t new/Test-WWW-Mechanize-1.60/t/get_ok.t --- old/Test-WWW-Mechanize-1.58/t/get_ok.t 2022-04-29 18:20:37.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/t/get_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 11; use Test::Builder::Tester; use URI::file (); @@ -11,6 +11,7 @@ my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); isa_ok($mech,'Test::WWW::Mechanize'); + GOOD_GET: { my $goodlinks = URI::file->new_abs( 't/goodlinks.html' )->as_string; @@ -46,4 +47,16 @@ ok( !$ok, 'And the result should be false' ); } + +UNDEF_URL: { + test_out( 'not ok 1 - Passing undef for a URL' ); + test_fail( +2 ); + test_diag( 'URL cannot be undef.' ); + my $ok = $mech->get_ok( undef, 'Passing undef for a URL' ); + test_test( 'Undef URLs' ); +} + + done_testing(); + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/head_ok.t new/Test-WWW-Mechanize-1.60/t/head_ok.t --- old/Test-WWW-Mechanize-1.58/t/head_ok.t 2022-04-29 18:20:37.000000000 +0200 +++ new/Test-WWW-Mechanize-1.60/t/head_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 11; use Test::WWW::Mechanize; @@ -49,4 +49,14 @@ ok( !$ok, 'And the result should be false' ); } + +UNDEF_URL: { + test_out( 'not ok 1 - Passing undef for a URL' ); + test_fail( +2 ); + test_diag( 'URL cannot be undef.' ); + my $ok = $mech->head_ok( undef, 'Passing undef for a URL' ); + test_test( 'Undef URLs' ); +} + + done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/headers.t new/Test-WWW-Mechanize-1.60/t/headers.t --- old/Test-WWW-Mechanize-1.58/t/headers.t 2020-12-22 05:08:18.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/headers.t 2022-12-05 05:19:45.000000000 +0100 @@ -14,7 +14,10 @@ use Test::WWW::Mechanize (); -my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); +my $mech = do { + local @ENV{qw( http_proxy HTTP_PROXY )}; + Test::WWW::Mechanize->new( autocheck => 0 ); +}; isa_ok($mech,'Test::WWW::Mechanize'); $mech->get_ok( "$server_root/form.html" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/post_ok.t new/Test-WWW-Mechanize-1.60/t/post_ok.t --- old/Test-WWW-Mechanize-1.58/t/post_ok.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/post_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -0,0 +1,25 @@ +#!perl -T + +use strict; +use warnings; +use Test::More tests => 2; +use Test::Builder::Tester; + +use Test::WWW::Mechanize (); + +my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); +isa_ok($mech,'Test::WWW::Mechanize'); + + +UNDEF_URL: { + test_out( 'not ok 1 - Passing undef for a URL' ); + test_fail( +2 ); + test_diag( 'URL cannot be undef.' ); + my $ok = $mech->post_ok( undef, 'Passing undef for a URL' ); + test_test( 'Undef URLs' ); +} + + +done_testing(); + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/put_ok.t new/Test-WWW-Mechanize-1.60/t/put_ok.t --- old/Test-WWW-Mechanize-1.58/t/put_ok.t 2020-12-22 05:08:18.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/put_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 8; use Test::Builder::Tester; use Test::WWW::Mechanize (); @@ -15,11 +15,13 @@ my $pid = $server->background; my $server_root = $server->root; -my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); -isa_ok($mech,'Test::WWW::Mechanize'); - my $text = 'This is what we are putting'; GOOD_PUT: { + local @ENV{qw( http_proxy HTTP_PROXY )}; + + my $mech = Test::WWW::Mechanize->new( autocheck => 0 ); + isa_ok($mech,'Test::WWW::Mechanize'); + my $scratch = "$server_root/scratch.html"; $mech->put_ok($scratch, {content => $text}); @@ -37,6 +39,20 @@ test_test('PUTs existing URI and reports success - default desc'); } + +UNDEF_URL: { + my $mech = Test::WWW::Mechanize->new(); + test_out( 'not ok 1 - Passing undef for a URL' ); + test_fail( +2 ); + test_diag( 'URL cannot be undef.' ); + my $ok = $mech->put_ok( undef, 'Passing undef for a URL' ); + test_test( 'Undef URLs' ); +} + + $server->stop; done_testing(); + + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-WWW-Mechanize-1.58/t/submit_form_ok.t new/Test-WWW-Mechanize-1.60/t/submit_form_ok.t --- old/Test-WWW-Mechanize-1.58/t/submit_form_ok.t 2020-12-22 05:08:18.000000000 +0100 +++ new/Test-WWW-Mechanize-1.60/t/submit_form_ok.t 2022-12-05 05:19:45.000000000 +0100 @@ -15,6 +15,8 @@ my $server_root = $server->root; SUBMIT_GOOD_FORM: { + local @ENV{qw( http_proxy HTTP_PROXY )}; + my $mech = Test::WWW::Mechanize->new(); isa_ok( $mech,'Test::WWW::Mechanize' );