diff options
author | gregor herrmann <gregoa@debian.org> | 2023-02-14 19:08:36 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2023-02-14 19:08:36 +0100 |
commit | cb9132dd53633af091520e3349b886a2ecf4da18 (patch) | |
tree | c5659385fe6c79b552e625faab7b47522efc31df | |
parent | b2e7b7c881aa214161eabcee75e8fc7617ce2940 (diff) | |
parent | b5ba3e076b0f01b1a5fbee90b3f90ab264c4a21a (diff) |
Update upstream source from tag 'upstream/2.16'
Update to upstream version '2.16'
with Debian dir e2426e547eb19f1ec95ebd9215e6dc1474f98b1e
49 files changed, 428 insertions, 274 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 38f26a7..dd1ce63 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -11,6 +11,7 @@ patches, bug reports, help with troubleshooting, etc. A huge * Andrew Grangaard * Andy Lester * Bernhard Wagner + * bscan * Chase Whitener * dakkar * Dave Doyle @@ -58,7 +59,9 @@ patches, bug reports, help with troubleshooting, etc. A huge * Stanislaw Pusep * Steve Scaffidi * Stuart Johnston + * Stuart Johnston * sunnavy + * tcheukueppo * Varadinsky * Ville Skyttä * Zefram @@ -1,9 +1,25 @@ Revision history for WWW::Mechanize +2.16 2023-02-11 12:09:16Z + [FIXED] + - Raise minimum Perl to 5.8 to match what we test, what dependencies + depend on, etc. (GH#352) (James Raspass) + [ENHANCEMENTS] + - New method delete() that allows DELETE requests with Mechanize::Link + objects (GH#361) (Stuart A Johnston) + [DOCUMENTATION] + - Clarify documentation for select() (GH#77) (Julien Fiegehenn) + - Various POD fixes (Julien Fiegehenn) + - Explain that :content-file does not decode content (GH#363) (bscan) + [TESTS] + - Test that follow_link(n=> 'all') warns (Kueppo Tcheukam) + - Drop Test::Warn prerequisite and only use Test::Warnings (GH#360) (Graham Knop) + 2.15 2022-08-21 07:47:35Z [FIXED] - There was a test suite failure on some Windows machines introduced in 2.14 that is now fixed. (GH#350) (Julien Fiegehenn) + [ENHANCEMENTS] - form_with and all_forms_with() now support the "action" attribute to find forms (GH#349) (Julien Fiegehenn) @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.025. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030. CONTRIBUTORS Changes INSTALL @@ -18,6 +18,7 @@ lib/WWW/Mechanize/FAQ.pod lib/WWW/Mechanize/Image.pm lib/WWW/Mechanize/Link.pm perlcriticrc +perlimports.toml perltidyrc script/mech-dump t/00-load.t @@ -4,7 +4,7 @@ "Andy Lester <andy at petdance.com>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.025, CPAN::Meta::Converter version 2.150010", + "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -80,7 +80,7 @@ "URI::URL" : "0", "URI::file" : "0", "base" : "0", - "perl" : "5.006", + "perl" : "5.008", "strict" : "0", "warnings" : "0" } @@ -119,15 +119,15 @@ "provides" : { "WWW::Mechanize" : { "file" : "lib/WWW/Mechanize.pm", - "version" : "2.15" + "version" : "2.16" }, "WWW::Mechanize::Image" : { "file" : "lib/WWW/Mechanize/Image.pm", - "version" : "2.15" + "version" : "2.16" }, "WWW::Mechanize::Link" : { "file" : "lib/WWW/Mechanize/Link.pm", - "version" : "2.15" + "version" : "2.16" } }, "release_status" : "stable", @@ -142,7 +142,7 @@ "web" : "https://github.com/libwww-perl/WWW-Mechanize" } }, - "version" : "2.15", + "version" : "2.16", "x_Dist_Zilla" : { "perl" : { "version" : "5.028000" @@ -183,22 +183,22 @@ { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::OALDERS/AutoPrereqs", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : "6" + "default_jobs" : "8" } }, "name" : "@Author::OALDERS/MakeMaker", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "@Author::OALDERS/CPANFile", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::ContributorsFile", @@ -208,37 +208,37 @@ { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::OALDERS/MetaJSON", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::OALDERS/MetaYAML", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::OALDERS/Manifest", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::OALDERS/MetaNoIndex", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::OALDERS/MetaConfig", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@Author::OALDERS/MetaResources", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::OALDERS/License", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", @@ -260,12 +260,12 @@ } }, "name" : "@Author::OALDERS/Modules for use with tidyall", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::OALDERS/ExecDir", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", @@ -275,7 +275,7 @@ { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::OALDERS/PodSyntaxTests", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", @@ -306,17 +306,17 @@ } }, "name" : "@Author::OALDERS/Test::Portability", - "version" : "2.001000" + "version" : "2.001001" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::OALDERS/TestRelease", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::OALDERS/Test::ReportPrereqs", - "version" : "0.028" + "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::Test::TidyAll", @@ -332,7 +332,7 @@ "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : "6" + "default_jobs" : "8" } }, "name" : "@Author::OALDERS/RunExtraTests", @@ -344,7 +344,7 @@ "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", - ":ExecFiles" + ":PerlExecFiles" ], "plugins" : [ { @@ -431,12 +431,12 @@ } }, "name" : "@Author::OALDERS/PodWeaver", - "version" : "4.009" + "version" : "4.010" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::OALDERS/PruneCruft", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", @@ -553,7 +553,7 @@ { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::OALDERS/ShareDir", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", @@ -563,12 +563,12 @@ { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::OALDERS/ConfirmRelease", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::OALDERS/UploadToCPAN", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs", @@ -579,7 +579,7 @@ } }, "name" : "@Author::OALDERS/@Git::VersionManager/pluginbundle version", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", @@ -656,7 +656,7 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v2.15", + "tag" : "v2.16", "tag_format" : "v%V", "tag_message" : "v%V" }, @@ -690,7 +690,7 @@ { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::OALDERS/@Git::VersionManager/NextRelease", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", @@ -742,13 +742,13 @@ { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "ExecDir", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : "6" + "default_jobs" : "8" } }, "name" : "RunExtraTests", @@ -768,7 +768,7 @@ } }, "name" : "RuntimeRequires", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs", @@ -779,7 +779,7 @@ } }, "name" : "TestRequires", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs", @@ -790,7 +790,7 @@ } }, "name" : "DevelopRequires", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs::Soften", @@ -815,7 +815,7 @@ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.025" + "version" : "6.030" } ], "include_underscores" : 0 @@ -837,57 +837,57 @@ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", - "version" : "6.025" + "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.025" + "version" : "6.030" } ], "zilla" : { @@ -895,7 +895,7 @@ "config" : { "is_trial" : 0 }, - "version" : "6.025" + "version" : "6.030" } }, "x_contributors" : [ @@ -904,6 +904,7 @@ "Andrew Grangaard <granny-github@ofb.net>", "Andy Lester <andy@petdance.com>", "Bernhard Wagner <gitcommit@bernhardwagner.net>", + "bscan <10503608+bscan@users.noreply.github.com>", "Chase Whitener <capoeirab@cpan.org>", "dakkar <dakkar@thenautilus.net>", "Dave Doyle <dave.s.doyle@gmail.com>", @@ -950,8 +951,10 @@ "Shoichi Kaji <skaji@cpan.org>", "Stanislaw Pusep <creaktive@gmail.com>", "Steve Scaffidi <stephen@scaffidi.net>", + "Stuart Johnston <117183+sjohnston@users.noreply.github.com>", "Stuart Johnston <saj_git@thecommune.net>", "sunnavy <sunnavy@bestpractical.com>", + "tcheukueppo <tcheukueppo@tutanota.com>", "Varadinsky <varadinsky@yahoo.com>", "Ville Skytt\u00e4 <ville.skytta@iki.fi>", "Zefram <zefram@fysh.org>", @@ -29,7 +29,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.025, CPAN::Meta::Converter version 2.150010' +generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -43,13 +43,13 @@ no_index: provides: WWW::Mechanize: file: lib/WWW/Mechanize.pm - version: '2.15' + version: '2.16' WWW::Mechanize::Image: file: lib/WWW/Mechanize/Image.pm - version: '2.15' + version: '2.16' WWW::Mechanize::Link: file: lib/WWW/Mechanize/Link.pm - version: '2.15' + version: '2.16' recommends: Compress::Zlib: '0' requires: @@ -69,14 +69,14 @@ requires: URI::URL: '0' URI::file: '0' base: '0' - perl: '5.006' + perl: '5.008' strict: '0' warnings: '0' resources: bugtracker: https://github.com/libwww-perl/WWW-Mechanize/issues homepage: https://github.com/libwww-perl/WWW-Mechanize repository: https://github.com/libwww-perl/WWW-Mechanize.git -version: '2.15' +version: '2.16' x_Dist_Zilla: perl: version: '5.028000' @@ -109,18 +109,18 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::OALDERS/AutoPrereqs' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: - default_jobs: '6' + default_jobs: '8' name: '@Author::OALDERS/MakeMaker' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::CPANFile name: '@Author::OALDERS/CPANFile' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::ContributorsFile name: '@Author::OALDERS/ContributorsFile' @@ -128,31 +128,31 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::OALDERS/MetaJSON' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::OALDERS/MetaYAML' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Manifest name: '@Author::OALDERS/Manifest' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::OALDERS/MetaNoIndex' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::OALDERS/MetaConfig' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MetaResources name: '@Author::OALDERS/MetaResources' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::License name: '@Author::OALDERS/License' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::InstallGuide config: @@ -168,11 +168,11 @@ x_Dist_Zilla: phase: develop type: requires name: '@Author::OALDERS/Modules for use with tidyall' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::OALDERS/ExecDir' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::OALDERS/MojibakeTests' @@ -180,7 +180,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::OALDERS/PodSyntaxTests' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Test::EOL config: @@ -203,15 +203,15 @@ x_Dist_Zilla: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::OALDERS/Test::Portability' - version: '2.001000' + version: '2.001001' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::OALDERS/TestRelease' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::OALDERS/Test::ReportPrereqs' - version: '0.028' + version: '0.029' - class: Dist::Zilla::Plugin::Test::TidyAll name: '@Author::OALDERS/Test::TidyAll' @@ -224,7 +224,7 @@ x_Dist_Zilla: class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: - default_jobs: '6' + default_jobs: '8' name: '@Author::OALDERS/RunExtraTests' version: '0.029' - @@ -233,7 +233,7 @@ x_Dist_Zilla: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - - ':ExecFiles' + - ':PerlExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 @@ -300,11 +300,11 @@ x_Dist_Zilla: name: '@Default/Legal' version: '4.015' name: '@Author::OALDERS/PodWeaver' - version: '4.009' + version: '4.010' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::OALDERS/PruneCruft' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: '@Author::OALDERS/CopyFilesFromBuild' @@ -394,7 +394,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::ShareDir name: '@Author::OALDERS/ShareDir' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::OALDERS/CheckIssues' @@ -402,11 +402,11 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::OALDERS/ConfirmRelease' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::OALDERS/UploadToCPAN' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Prereqs config: @@ -414,7 +414,7 @@ x_Dist_Zilla: phase: develop type: recommends name: '@Author::OALDERS/@Git::VersionManager/pluginbundle version' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: @@ -474,7 +474,7 @@ x_Dist_Zilla: branch: ~ changelog: Changes signed: 0 - tag: v2.15 + tag: v2.16 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: @@ -499,7 +499,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::NextRelease name: '@Author::OALDERS/@Git::VersionManager/NextRelease' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Git::Commit config: @@ -537,12 +537,12 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::ExecDir name: ExecDir - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: - default_jobs: '6' + default_jobs: '8' name: RunExtraTests version: '0.029' - @@ -556,7 +556,7 @@ x_Dist_Zilla: phase: runtime type: requires name: RuntimeRequires - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Prereqs config: @@ -564,7 +564,7 @@ x_Dist_Zilla: phase: test type: requires name: TestRequires - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Prereqs config: @@ -572,7 +572,7 @@ x_Dist_Zilla: phase: develop type: requires name: DevelopRequires - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::Prereqs::Soften config: @@ -592,7 +592,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM - version: '6.025' + version: '6.030' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' @@ -607,58 +607,59 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' - version: '6.025' + version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM - version: '6.025' + version: '6.030' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' - version: '6.025' + version: '6.030' x_contributors: - 'Alastair Douglas <altreus@altre.us>' - 'Alexandr Ciornii <alexchorny@gmail.com>' - 'Andrew Grangaard <granny-github@ofb.net>' - 'Andy Lester <andy@petdance.com>' - 'Bernhard Wagner <gitcommit@bernhardwagner.net>' + - 'bscan <10503608+bscan@users.noreply.github.com>' - 'Chase Whitener <capoeirab@cpan.org>' - 'dakkar <dakkar@thenautilus.net>' - 'Dave Doyle <dave.s.doyle@gmail.com>' @@ -705,8 +706,10 @@ x_contributors: - 'Shoichi Kaji <skaji@cpan.org>' - 'Stanislaw Pusep <creaktive@gmail.com>' - 'Steve Scaffidi <stephen@scaffidi.net>' + - 'Stuart Johnston <117183+sjohnston@users.noreply.github.com>' - 'Stuart Johnston <saj_git@thecommune.net>' - 'sunnavy <sunnavy@bestpractical.com>' + - 'tcheukueppo <tcheukueppo@tutanota.com>' - 'Varadinsky <varadinsky@yahoo.com>' - 'Ville Skyttä <ville.skytta@iki.fi>' - 'Zefram <zefram@fysh.org>' diff --git a/Makefile.PL b/Makefile.PL index e8cbd41..5f98a55 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,8 +1,8 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.025. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030. use strict; use warnings; -use 5.006; +use 5.008; use ExtUtils::MakeMaker; @@ -17,7 +17,7 @@ my %WriteMakefileArgs = ( "script/mech-dump" ], "LICENSE" => "perl", - "MIN_PERL_VERSION" => "5.006", + "MIN_PERL_VERSION" => "5.008", "NAME" => "WWW::Mechanize", "PREREQ_PM" => { "Carp" => 0, @@ -64,7 +64,7 @@ my %WriteMakefileArgs = ( "bytes" => 0, "lib" => 0 }, - "VERSION" => "2.15", + "VERSION" => "2.16", "test" => { "TESTS" => "t/*.t t/local/*.t t/mech-dump/*.t" } @@ -4,7 +4,7 @@ WWW::Mechanize - Handy web browsing in a Perl object # VERSION -version 2.15 +version 2.16 # SYNOPSIS @@ -296,6 +296,11 @@ internals is deprecated and subject to change in the future. and you can rest assured that the params will get filtered down appropriately. See ["get" in LWP::UserAgent](https://metacpan.org/pod/LWP%3A%3AUserAgent#get) for more details. +**NOTE:** The file in `:content_file` will contain the raw content of +the response. If the response content is encoded (e.g. gzip encoded), +the file will be encoded as well. Use $mech->save\_content if you need +the decoded content. + **NOTE:** Because `:content_file` causes the page contents to be stored in a file instead of the response object, some Mech functions that expect it to be there won't work as expected. Use with caution. @@ -331,8 +336,8 @@ PUTs `$content` to `$uri`. Returns an [HTTP::Response](https://metacpan.org/pod `$uri` can be a well-formed URI string, a [URI](https://metacpan.org/pod/URI) object, or a [WWW::Mechanize::Link](https://metacpan.org/pod/WWW%3A%3AMechanize%3A%3ALink) object. - my $res = $mech->head( $uri ); - my $res = $mech->head( $uri , $field_name => $value, ... ); + my $res = $mech->put( $uri ); + my $res = $mech->put( $uri , $field_name => $value, ... ); ## $mech->head ($uri ) @@ -340,6 +345,12 @@ Performs a HEAD request to `$uri`. Returns an [HTTP::Response](https://metacpan. `$uri` can be a well-formed URI string, a [URI](https://metacpan.org/pod/URI) object, or a [WWW::Mechanize::Link](https://metacpan.org/pod/WWW%3A%3AMechanize%3A%3ALink) object. +## $mech->delete ($uri ) + +Performs a DELETE request to `$uri`. Returns an [HTTP::Response](https://metacpan.org/pod/HTTP%3A%3AResponse) object. +`$uri` can be a well-formed URI string, a [URI](https://metacpan.org/pod/URI) object, or a +[WWW::Mechanize::Link](https://metacpan.org/pod/WWW%3A%3AMechanize%3A%3ALink) object. + ## $mech->reload() Acts like the reload button in a browser: repeats the current @@ -1005,29 +1016,67 @@ index mean: Index 0 is the _filepath_ that will be read from disk. Index 1 is the filename which will be used in the HTTP request body; if not given, -filepath (index 0) is used instead. If `<Content =` 'content here'>> is +filepath (index 0) is used instead. If `Content => 'content here'` is used as shown, then _filepath_ will be ignored. The optional `$number` parameter is used to distinguish between two fields with the same name. The fields are numbered from 1. -## $mech->select($name, $value) +## $mech->select($name, $new\_or\_additional\_single\_value) -## $mech->select($name, \\@values) +## $mech->select($name, \\%new\_single\_value\_by\_number) + +## $mech->select($name, \\@new\_list\_of\_values) + +## $mech->select($name, \\%new\_list\_of\_values\_by\_number) Given the name of a `select` field, set its value to the value -specified. If the field is not `<select multiple>` and the -`$value` is an array, only the **first** value will be set. \[Note: -the documentation previously claimed that only the last value would -be set, but this was incorrect.\] Passing `$value` as a hash with -an `n` key selects an item by number (e.g. -`{n => 3}` or `{n => [2,4]}`). +specified. + + # select 'foo' + $mech->select($name, 'foo'); + +If the field is not `<select multiple>` and the +`$value` is an array reference, only the **first** value will be set. \[Note: +until version 1.05\_03 the documentation claimed that only the last value would +be set, but this was incorrect.\] + + # select 'bar' + $mech->select($name, ['bar', 'ignored', 'ignored']); + +Passing `$value` as a hash reference with an `n` key selects an item by number. + + # select the third value + $mech->select($name, {n => 3}); + The numbering starts at 1. This applies to the current form. If you have a field with `<select multiple>` and you pass a single `$value`, then `$value` will be added to the list of fields selected, -without clearing the others. However, if you pass an array reference, -then all previously selected values will be cleared. +without clearing the others. + + # add 'bar' to the list of selected values + $mech->select($name, 'bar'); + +However, if you pass an array reference, then all previously selected values +will be cleared and replaced with all values inside the array reference. + + # replace the selection with 'foo' and 'bar' + $mech->select($name, ['foo', 'bar']); + +This also works when selecting by numbers, in which case the value of the `n` +key will be an array reference of value numbers you want to replace the +selection with. + + # replace the selection with the 2nd and 4th element + $mech->select($name, {n => [2, 4]}); + +To add multiple additional values to the list of selected fields without +clearing, call `select` in the simple `$value` form with each single value +in a loop. + + # add all values in the array to the selection + $mech->select($name, $_) for @additional_values; Returns true on successfully setting the value. On failure, returns false and calls `$self->warn()` with an error message. @@ -1,4 +1,4 @@ -# This file is generated by Dist::Zilla::Plugin::CPANFile v6.025 +# This file is generated by Dist::Zilla::Plugin::CPANFile v6.030 # Do not edit this file directly. To change prereqs, edit the `dist.ini` file. requires "Carp" => "0"; @@ -17,7 +17,7 @@ requires "Tie::RefHash" => "0"; requires "URI::URL" => "0"; requires "URI::file" => "0"; requires "base" => "0"; -requires "perl" => "5.006"; +requires "perl" => "5.008"; requires "strict" => "0"; requires "warnings" => "0"; recommends "Compress::Zlib" => "0"; @@ -23,7 +23,7 @@ dir = script [Test::Pod::LinkCheck] [Prereqs / RuntimeRequires] -perl = 5.006 +perl = 5.008 HTML::Form = 6.08 Scalar::Util = 1.14 diff --git a/lib/WWW/Mechanize.pm b/lib/WWW/Mechanize.pm index 1d0060c..2d0a9ad 100644 --- a/lib/WWW/Mechanize.pm +++ b/lib/WWW/Mechanize.pm @@ -6,7 +6,7 @@ package WWW::Mechanize; use strict; use warnings; -our $VERSION = '2.15'; +our $VERSION = '2.16'; use Tie::RefHash (); use HTTP::Request 1.30 (); @@ -112,11 +112,7 @@ sub get { my $self = shift; my $uri = shift; - $uri = $uri->url if ref($uri) eq 'WWW::Mechanize::Link'; - - $uri = $self->base - ? URI->new_abs( $uri, $self->base ) - : URI->new( $uri ); + $uri = $self->_uri_with_base( $uri ); # It appears we are returning a super-class method, # but it in turn calls the request() method here in Mechanize @@ -128,11 +124,7 @@ sub post { my $self = shift; my $uri = shift; - $uri = $uri->url if ref($uri) eq 'WWW::Mechanize::Link'; - - $uri = $self->base - ? URI->new_abs( $uri, $self->base ) - : URI->new( $uri ); + $uri = $self->_uri_with_base( $uri ); # It appears we are returning a super-class method, # but it in turn calls the request() method here in Mechanize @@ -144,11 +136,7 @@ sub put { my $self = shift; my $uri = shift; - $uri = $uri->url if ref($uri) eq 'WWW::Mechanize::Link'; - - $uri = $self->base - ? URI->new_abs( $uri, $self->base ) - : URI->new( $uri ); + $uri = $self->_uri_with_base( $uri ); # It appears we are returning a super-class method, # but it in turn calls the request() method here in Mechanize @@ -169,15 +157,36 @@ sub head { my $self = shift; my $uri = shift; + $uri = $self->_uri_with_base( $uri ); + + # It appears we are returning a super-class method, + # but it in turn calls the request() method here in Mechanize + return $self->SUPER::head( $uri->as_string, @_ ); +} + + +sub delete { + my $self = shift; + my $uri = shift; + + $uri = $self->_uri_with_base( $uri ); + + # It appears we are returning a super-class method, + # but it in turn calls the request() method here in Mechanize + return $self->SUPER::delete( $uri->as_string, @_ ); +} + +sub _uri_with_base { + my $self = shift; + my $uri = shift; + $uri = $uri->url if ref($uri) eq 'WWW::Mechanize::Link'; $uri = $self->base ? URI->new_abs( $uri, $self->base ) : URI->new( $uri ); - # It appears we are returning a super-class method, - # but it in turn calls the request() method here in Mechanize - return $self->SUPER::head( $uri->as_string, @_ ); + return $uri; } @@ -791,7 +800,7 @@ sub form_with { unless ( defined $spec{$_} ) { # case $attr => undef qq{no $_}; } - elsif ( $spec{$_} eq '' ) { # case $attr=> '' + elsif ( $spec{$_} eq q{} ) { # case $attr=> '' qq{empty $_}; } else { # case $attr => $value @@ -800,7 +809,7 @@ sub form_with { } # case $attr => undef sort keys %spec # sort keys to get deterministic messages ) - : '' + : q{} ) . '. The first one was used.' ); @@ -1014,7 +1023,7 @@ sub tick { # Sometimes the HTML is malformed and there is no value for the check # box, so we just return if the value passed is an empty string # (and the form input is found) - if ($value eq '') { + if ($value eq q{}) { $input->value($set ? $value : undef); return; } @@ -1290,7 +1299,7 @@ sub save_content { } open( my $fh, '>', $filename ) or $self->die( "Unable to create $filename: $!" ); - if ((my $binmode = delete($opts{binmode}) || '') || ($self->content_type() !~ m{^text/})) { + if ((my $binmode = delete($opts{binmode}) || q{}) || ($self->content_type() !~ m{^text/})) { if (length($binmode) && (substr($binmode, 0, 1) eq ':')) { binmode $fh, $binmode; } @@ -1308,7 +1317,7 @@ sub save_content { sub _get_fh_default_stdout { my $self = shift; - my $p = shift || ''; + my $p = shift || q{}; if ( !$p ) { return \*STDOUT; } elsif ( !ref($p) ) { @@ -1337,7 +1346,7 @@ sub dump_links { for my $link ( $self->links ) { my $url = $absolute ? $link->url_abs : $link->url; - $url = '' if not defined $url; + $url = q{} if not defined $url; print {$fh} $url, "\n"; } return; @@ -1351,7 +1360,7 @@ sub dump_images { for my $image ( $self->images ) { my $url = $absolute ? $image->url_abs : $image->url; - $url = '' if not defined $url; + $url = q{} if not defined $url; print {$fh} $url, "\n"; } return; @@ -1477,7 +1486,7 @@ sub _update_page { $self->{status} = $res->code; $self->{base} = $res->base; - $self->{ct} = $res->content_type || ''; + $self->{ct} = $res->content_type || q{}; if ( $res->is_success ) { $self->{uri} = $self->{redirected_uri}; @@ -1524,7 +1533,7 @@ sub _taintedness { return $_taintbrush if tainted( $_taintbrush ); # Let's try again. Maybe somebody cleaned those. - $_taintbrush = substr(join('', grep { defined } @ARGV, %ENV), 0, 0); + $_taintbrush = substr(join(q{}, grep { defined } @ARGV, %ENV), 0, 0); return $_taintbrush if tainted( $_taintbrush ); # If those don't work, go try to open some file from some unsafe @@ -1758,7 +1767,7 @@ sub _link_from_token { my $name; if ( $tag eq 'a' ) { $text = $parser->get_trimmed_text("/$tag"); - $text = '' unless defined $text; + $text = q{} unless defined $text; my $onClick = $attrs->{onclick}; if ( $onClick && ($onClick =~ /^window\.open\(\s*'([^']+)'/) ) { @@ -1891,7 +1900,7 @@ WWW::Mechanize - Handy web browsing in a Perl object =head1 VERSION -version 2.15 +version 2.16 =head1 SYNOPSIS @@ -2224,6 +2233,11 @@ L<LWP::UserAgent>. This lets you do things like and you can rest assured that the params will get filtered down appropriately. See L<LWP::UserAgent/get> for more details. +B<NOTE:> The file in C<:content_file> will contain the raw content of +the response. If the response content is encoded (e.g. gzip encoded), +the file will be encoded as well. Use $mech->save_content if you need +the decoded content. + B<NOTE:> Because C<:content_file> causes the page contents to be stored in a file instead of the response object, some Mech functions that expect it to be there won't work as expected. Use with caution. @@ -2259,8 +2273,8 @@ PUTs C<$content> to C<$uri>. Returns an L<HTTP::Response> object. C<$uri> can be a well-formed URI string, a L<URI> object, or a L<WWW::Mechanize::Link> object. - my $res = $mech->head( $uri ); - my $res = $mech->head( $uri , $field_name => $value, ... ); + my $res = $mech->put( $uri ); + my $res = $mech->put( $uri , $field_name => $value, ... ); =head2 $mech->head ($uri ) @@ -2268,6 +2282,12 @@ Performs a HEAD request to C<$uri>. Returns an L<HTTP::Response> object. C<$uri> can be a well-formed URI string, a L<URI> object, or a L<WWW::Mechanize::Link> object. +=head2 $mech->delete ($uri ) + +Performs a DELETE request to C<$uri>. Returns an L<HTTP::Response> object. +C<$uri> can be a well-formed URI string, a L<URI> object, or a +L<WWW::Mechanize::Link> object. + =head2 $mech->reload() Acts like the reload button in a browser: repeats the current @@ -2958,29 +2978,67 @@ index mean: Index 0 is the I<filepath> that will be read from disk. Index 1 is the filename which will be used in the HTTP request body; if not given, -filepath (index 0) is used instead. If C<<Content => 'content here'>> is +filepath (index 0) is used instead. If C<< Content => 'content here' >> is used as shown, then I<filepath> will be ignored. The optional C<$number> parameter is used to distinguish between two fields with the same name. The fields are numbered from 1. -=head2 $mech->select($name, $value) +=head2 $mech->select($name, $new_or_additional_single_value) + +=head2 $mech->select($name, \%new_single_value_by_number) -=head2 $mech->select($name, \@values) +=head2 $mech->select($name, \@new_list_of_values) + +=head2 $mech->select($name, \%new_list_of_values_by_number) Given the name of a C<select> field, set its value to the value -specified. If the field is not C<< <select multiple> >> and the -C<$value> is an array, only the B<first> value will be set. [Note: -the documentation previously claimed that only the last value would -be set, but this was incorrect.] Passing C<$value> as a hash with -an C<n> key selects an item by number (e.g. -C<< {n => 3} >> or C<< {n => [2,4]} >>). +specified. + + # select 'foo' + $mech->select($name, 'foo'); + +If the field is not C<< <select multiple> >> and the +C<$value> is an array reference, only the B<first> value will be set. [Note: +until version 1.05_03 the documentation claimed that only the last value would +be set, but this was incorrect.] + + # select 'bar' + $mech->select($name, ['bar', 'ignored', 'ignored']); + +Passing C<$value> as a hash reference with an C<n> key selects an item by number. + + # select the third value + $mech->select($name, {n => 3}); + The numbering starts at 1. This applies to the current form. If you have a field with C<< <select multiple> >> and you pass a single C<$value>, then C<$value> will be added to the list of fields selected, -without clearing the others. However, if you pass an array reference, -then all previously selected values will be cleared. +without clearing the others. + + # add 'bar' to the list of selected values + $mech->select($name, 'bar'); + +However, if you pass an array reference, then all previously selected values +will be cleared and replaced with all values inside the array reference. + + # replace the selection with 'foo' and 'bar' + $mech->select($name, ['foo', 'bar']); + +This also works when selecting by numbers, in which case the value of the C<n> +key will be an array reference of value numbers you want to replace the +selection with. + + # replace the selection with the 2nd and 4th element + $mech->select($name, {n => [2, 4]}); + +To add multiple additional values to the list of selected fields without +clearing, call C<select> in the simple C<$value> form with each single value +in a loop. + + # add all values in the array to the selection + $mech->select($name, $_) for @additional_values; Returns true on successfully setting the value. On failure, returns false and calls C<< $self->warn() >> with an error message. diff --git a/lib/WWW/Mechanize/Cookbook.pod b/lib/WWW/Mechanize/Cookbook.pod index ac3fb4d..cd16491 100644 --- a/lib/WWW/Mechanize/Cookbook.pod +++ b/lib/WWW/Mechanize/Cookbook.pod @@ -13,7 +13,7 @@ WWW::Mechanize::Cookbook - Recipes for using WWW::Mechanize =head1 VERSION -version 2.15 +version 2.16 =head1 INTRODUCTION diff --git a/lib/WWW/Mechanize/Examples.pod b/lib/WWW/Mechanize/Examples.pod index 8fe2cf0..806acd6 100644 --- a/lib/WWW/Mechanize/Examples.pod +++ b/lib/WWW/Mechanize/Examples.pod @@ -13,7 +13,7 @@ WWW::Mechanize::Examples - Sample programs that use WWW::Mechanize =head1 VERSION -version 2.15 +version 2.16 =head1 SYNOPSIS diff --git a/lib/WWW/Mechanize/FAQ.pod b/lib/WWW/Mechanize/FAQ.pod index 2922c2a..6eef46b 100644 --- a/lib/WWW/Mechanize/FAQ.pod +++ b/lib/WWW/Mechanize/FAQ.pod @@ -13,7 +13,7 @@ WWW::Mechanize::FAQ - Frequently Asked Questions about WWW::Mechanize =head1 VERSION -version 2.15 +version 2.16 =head1 How to get help with WWW::Mechanize diff --git a/lib/WWW/Mechanize/Image.pm b/lib/WWW/Mechanize/Image.pm index 2ba6441..ad7e704 100644 --- a/lib/WWW/Mechanize/Image.pm +++ b/lib/WWW/Mechanize/Image.pm @@ -3,7 +3,7 @@ package WWW::Mechanize::Image; use strict; use warnings; -our $VERSION = '2.15'; +our $VERSION = '2.16'; #ABSTRACT: Image object for WWW::Mechanize @@ -69,7 +69,7 @@ WWW::Mechanize::Image - Image object for WWW::Mechanize =head1 VERSION -version 2.15 +version 2.16 =head1 SYNOPSIS diff --git a/lib/WWW/Mechanize/Link.pm b/lib/WWW/Mechanize/Link.pm index bad10ef..b76da1b 100644 --- a/lib/WWW/Mechanize/Link.pm +++ b/lib/WWW/Mechanize/Link.pm @@ -3,7 +3,7 @@ package WWW::Mechanize::Link; use strict; use warnings; -our $VERSION = '2.15'; +our $VERSION = '2.16'; #ABSTRACT: Link object for WWW::Mechanize @@ -65,7 +65,7 @@ WWW::Mechanize::Link - Link object for WWW::Mechanize =head1 VERSION -version 2.15 +version 2.16 =head1 SYNOPSIS diff --git a/perlimports.toml b/perlimports.toml new file mode 100644 index 0000000..65eac49 --- /dev/null +++ b/perlimports.toml @@ -0,0 +1,25 @@ +# Valid log levels are: +# debug, info, notice, warning, error, critical, alert, emergency +# critical, alert and emergency are not currently used. +# +# Please use boolean values in this config file. Negated options (--no-*) are +# not permitted here. Explicitly set options to true or false. +# +# Some of these values deviate from the regular perlimports defaults. In +# particular, you're encouraged to leave preserve_duplicates and +# preserve_unused disabled. + +cache = false # setting this to true is currently discouraged +ignore_modules = ["Test::More"] +ignore_modules_filename = "" +ignore_modules_pattern = "" # regex like "^(Foo|Foo::Bar)" +ignore_modules_pattern_filename = "" +libs = ["lib", "t", "t/local"] +log_filename = "" +log_level = "warn" +never_export_modules = [] +never_export_modules_filename = "" +padding = true +preserve_duplicates = false +preserve_unused = false +tidy_whitespace = true diff --git a/script/mech-dump b/script/mech-dump index d7073b0..2178451 100755 --- a/script/mech-dump +++ b/script/mech-dump @@ -142,7 +142,7 @@ mech-dump - Dumps information about a web page =head1 VERSION -version 2.15 +version 2.16 =head1 SYNOPSIS diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd index c541842..690788b 100644 --- a/t/00-report-prereqs.dd +++ b/t/00-report-prereqs.dd @@ -58,7 +58,7 @@ do { my $x = { 'URI::URL' => '0', 'URI::file' => '0', 'base' => '0', - 'perl' => '5.006', + 'perl' => '5.008', 'strict' => '0', 'warnings' => '0' } diff --git a/t/00-report-prereqs.t b/t/00-report-prereqs.t index c3a94ca..5696476 100644 --- a/t/00-report-prereqs.t +++ b/t/00-report-prereqs.t @@ -3,7 +3,7 @@ use strict; use warnings; -# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; @@ -109,20 +109,24 @@ for my $phase ( qw(configure build test runtime develop other) ) { my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { - next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; - my $file = $mod; - $file =~ s{::}{/}g; - $file .= ".pm"; - my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; - my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; + if ($mod eq 'perl') { + push @reports, ['perl', $want, $]]; + next; + } + my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; + my $file = $mod; + $file =~ s{::}{/}g; + $file .= ".pm"; + my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; + if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; diff --git a/t/add_header.t b/t/add_header.t index 96f98fd..4671a92 100644 --- a/t/add_header.t +++ b/t/add_header.t @@ -6,7 +6,6 @@ use Test::More tests => 4; use HTTP::Request::Common qw( GET ); BEGIN { - delete @ENV{qw( PATH IFS CDPATH ENV BASH_ENV )}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -7,7 +7,6 @@ use Test::More; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/file_upload.t b/t/file_upload.t index 61b4ff7..791634d 100644 --- a/t/file_upload.t +++ b/t/file_upload.t @@ -2,8 +2,8 @@ use strict; use warnings; use Test::More; use Test::Exception; -use WWW::Mechanize; -use URI::file; +use WWW::Mechanize (); +use URI::file (); my $file = 't/file_upload.html'; my $filename = 'the_file_upload.html'; diff --git a/t/find_frame.t b/t/find_frame.t index dff0a53..703df9d 100644 --- a/t/find_frame.t +++ b/t/find_frame.t @@ -6,7 +6,6 @@ use Test::More tests => 5; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/find_image.t b/t/find_image.t index d799426..666448e 100644 --- a/t/find_image.t +++ b/t/find_image.t @@ -10,7 +10,6 @@ use Test::Deep qw( all cmp_deeply isa methods re superhashof ); use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/find_inputs.t b/t/find_inputs.t index 258d857..bea16e0 100644 --- a/t/find_inputs.t +++ b/t/find_inputs.t @@ -7,7 +7,6 @@ use Test::More tests => 11; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/find_link-warnings.t b/t/find_link-warnings.t index 5d2206f..eca3775 100644 --- a/t/find_link-warnings.t +++ b/t/find_link-warnings.t @@ -2,12 +2,10 @@ use warnings; use strict; use Test::More; -use Test::Warn qw( warning_like ); +use Test::Warnings qw( :all ); use URI::file (); use WWW::Mechanize (); -BEGIN { delete @ENV{ qw( http_proxy HTTP_PROXY PATH IFS CDPATH ENV BASH_ENV) }; } - my $mech = WWW::Mechanize->new( cookie_jar => undef, max_redirect => 0 ); isa_ok( $mech, 'WWW::Mechanize' ); @@ -18,38 +16,38 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; REGEX_USAGE: { for my $tname (qw( TEXT NAME URL TAG )) { - warning_like( - sub { $mech->find_link( $tname => 'expect error' ) }, - qr/Unknown link-finding parameter/, "detected usage error: $tname => 'string'" - ); + like warning { + $mech->find_link( $tname => 'expect error' ); + }, qr/Unknown link-finding parameter/, + "detected usage error: $tname => 'string'"; } } REGEX_STRING: { for my $tn (qw( text name url tag )) { my $tname = $tn.'_regex'; - warning_like( - sub { $mech->find_link( $tname => 'expect error' ) }, - qr/passed as $tname is not a regex/, "detected usage error: $tname => 'string'" - ); + like warning { + $mech->find_link( $tname => 'expect error' ); + }, qr/passed as $tname is not a regex/, + "detected usage error: $tname => 'string'"; } } NON_REGEX_STRING: { for my $tname (qw( text name url tag )) { - warning_like( - sub { $mech->find_link( $tname => qr/foo/ ) }, - qr/passed as '$tname' is a regex/, "detected usage error: $tname => Regex" - ); + like warning { + $mech->find_link( $tname => qr/foo/ ); + }, qr/passed as '$tname' is a regex/, + "detected usage error: $tname => Regex"; } } SPACE_PADDED: { for my $tname (qw( text name url tag )) { - warning_like( - sub { $mech->find_link( $tname => ' a padded astring ' ) }, - qr/is space-padded and cannot succeed/, "detected usage error: $tname => padded-string" - ); + like warning { + $mech->find_link( $tname => ' a padded astring ' ); + }, qr/is space-padded and cannot succeed/, + "detected usage error: $tname => padded-string"; } } diff --git a/t/find_link.t b/t/find_link.t index 7957569..e3c85f6 100644 --- a/t/find_link.t +++ b/t/find_link.t @@ -7,7 +7,6 @@ use Test::More; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/find_link_id.t b/t/find_link_id.t index 5ce8fde..27e83a7 100644 --- a/t/find_link_id.t +++ b/t/find_link_id.t @@ -6,7 +6,6 @@ use Test::More 'no_plan'; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/find_link_xhtml.t b/t/find_link_xhtml.t index 27cc3a5..34a3213 100644 --- a/t/find_link_xhtml.t +++ b/t/find_link_xhtml.t @@ -7,7 +7,6 @@ use Test::More; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/form_with_fields.t b/t/form_with_fields.t index 2a5e940..5b27f87 100644 --- a/t/form_with_fields.t +++ b/t/form_with_fields.t @@ -5,11 +5,10 @@ use strict; use Test::More 'no_plan'; use Test::Fatal qw( exception ); use Test::Warnings ':all'; -use Test::Deep qw( cmp_deeply re array_each code ); +use Test::Deep qw( array_each cmp_deeply code re ); use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -111,7 +110,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; like( exception { $mech->submit_form( - with_fields => { 'xx' => '' }, + with_fields => { 'xx' => q{} }, ); }, qr/There is no form with the requested fields/, @@ -124,7 +123,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; like( exception { $mech->submit_form( - with_fields => { '1a' => '' }, + with_fields => { '1a' => q{} }, form_number => 2, ); }, @@ -165,7 +164,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; is( exception { $mech->submit_form( - with_fields => { 'x' => '' }, + with_fields => { 'x' => q{} }, form_name => '3rd_form_ambiguous', ); }, @@ -179,7 +178,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; is( exception { $mech->submit_form( - with_fields => { '1b' => '', 'opt[2]' => '' }, + with_fields => { '1b' => q{}, 'opt[2]' => q{} }, ); }, undef, diff --git a/t/form_with_fields_passthrough_params.t b/t/form_with_fields_passthrough_params.t index e73208d..22070e6 100644 --- a/t/form_with_fields_passthrough_params.t +++ b/t/form_with_fields_passthrough_params.t @@ -9,7 +9,6 @@ use Test::Deep qw( cmp_deeply re ); use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -71,7 +70,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; like( exception { $mech->submit_form( - with_fields => { 'xx' => '' }, + with_fields => { 'xx' => q{} }, ); }, qr/There is no form with the requested fields/, @@ -84,7 +83,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; like( exception { $mech->submit_form( - with_fields => { '1a' => '' }, + with_fields => { '1a' => q{} }, form_number => 2, ); }, @@ -125,7 +124,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; is( exception { $mech->submit_form( - with_fields => { 'x' => '' }, + with_fields => { 'x' => q{} }, form_name => '3rd_form_ambiguous', ); }, @@ -139,7 +138,7 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; is( exception { $mech->submit_form( - with_fields => { '1b' => '', 'opt[2]' => '' }, + with_fields => { '1b' => q{}, 'opt[2]' => q{} }, ); }, undef, @@ -243,4 +242,4 @@ ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; ); isa_ok( $form, 'HTML::Form' ); is($form->attr('name'), '1st_form', '... and form matches'); -}
\ No newline at end of file +} @@ -6,7 +6,6 @@ use Test::More tests => 7; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/history.t b/t/history.t index 1cd1731..cd0dc26 100644 --- a/t/history.t +++ b/t/history.t @@ -14,8 +14,6 @@ use URI::file (); use WWW::Mechanize (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)} - ; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok('WWW::Mechanize'); } diff --git a/t/image-parse.t b/t/image-parse.t index 70d2a00..ad3bf3f 100644 --- a/t/image-parse.t +++ b/t/image-parse.t @@ -7,7 +7,6 @@ use Test::More tests => 47; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -83,7 +82,7 @@ $mech->get( $uri ); ok( $mech->success, "Fetched $uri" ) or die q{Can't get test page}; eval { @images = $mech->find_all_images(); }; -is($@,'','survived eval'); +is($@,q{},'survived eval'); is( scalar @images, 2, 'Exactly two images' ); my $css_first = $images[0]; @@ -93,4 +92,4 @@ is( $css_first->alt, undef, 'alt' ); my $css_second = $images[1]; is( $css_second->url, 'images/logo.png', 'Got the second image' ); -is( $css_second->tag, 'css', 'css tag' );
\ No newline at end of file +is( $css_second->tag, 'css', 'css tag' ); diff --git a/t/link-relative.t b/t/link-relative.t index f8ab75e..4d9fe60 100644 --- a/t/link-relative.t +++ b/t/link-relative.t @@ -7,7 +7,6 @@ use Test::More tests => 6; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } diff --git a/t/local/LocalServer.pm b/t/local/LocalServer.pm index d12759e..41a5251 100644 --- a/t/local/LocalServer.pm +++ b/t/local/LocalServer.pm @@ -99,7 +99,7 @@ sub spawn { close $fh; push @{$self->{delete}},$logfile; $self->{logfile} = $logfile; - my $web_page = delete $args{file} || ""; + my $web_page = delete $args{file} || q{}; my $server_file = path('t/local/log-server')->absolute; my @opts; diff --git a/t/local/follow.t b/t/local/follow.t index 79d800c..9484800 100644 --- a/t/local/follow.t +++ b/t/local/follow.t @@ -2,6 +2,7 @@ use warnings; use strict; use Test::More; use Test::Exception; +use Test::Warnings qw(warning); use lib 't/local'; use LocalServer (); @@ -56,6 +57,10 @@ ok($agent->follow_link( url => '/foo' ), 'can follow url'); isnt( $agent->uri, $server->url, 'Need to be on a separate page' ); ok($agent->back(), 'Can still go back'); +$agent->quiet(0); +like warning { $agent->follow_link( n => 'all' ) }, qr/^follow_link\(.*?\) is not valid/, "Can we follow all links?"; +ok( $agent->back(), 'Can still go back' ); + ok(!$agent->follow_link( url => '/notfoo' ), "can't follow wrong url"); is( $agent->uri, $server->url, 'Needs to be on the same page' ); eval {$agent->follow_link( '/foo' )}; @@ -63,4 +68,4 @@ like($@, qr/Needs to get key-value pairs of parameters.*follow\.t/, "Invalid par dies_ok { WWW::Mechanize->new->follow_link( url => '/404' ) } "dies when link does not exist with autocheck"; -done_testing;
\ No newline at end of file +done_testing; diff --git a/t/local/form.t b/t/local/form.t index b42873e..7d17f92 100644 --- a/t/local/form.t +++ b/t/local/form.t @@ -89,12 +89,12 @@ is( $mech->current_form, $form_number_1, my $form_number_2 = $mech->form_number(2); $form_with = - $mech->form_with( class => 'test', foo => '', bar => undef, { n => 2 } ); + $mech->form_with( class => 'test', foo => q{}, bar => undef, { n => 2 } ); is( $form_with, $form_number_2, 'Can select nth form with ambiguous criteria' ); is( scalar @warnings, 0, 'no warnings so far' ); $mech->quiet(0); -$form_with = $mech->form_with( class => 'test', foo => '', bar => undef ); +$form_with = $mech->form_with( class => 'test', foo => q{}, bar => undef ); is( $form_with, $form_number_1, 'form_with - can select form with ambiguous criteria' ); is( scalar @warnings, 1, 'form_with - got one warning' ); diff --git a/t/local/select_multiple.t b/t/local/select_multiple.t index da550fd..1ed72e0 100644 --- a/t/local/select_multiple.t +++ b/t/local/select_multiple.t @@ -49,7 +49,7 @@ eval { } ); }; -is( $@, '', 'submit_form, second value' ); +is( $@, q{}, 'submit_form, second value' ); like( $mech->uri, qr/chanId=119/, '... and the second value was set'); eval { @@ -58,7 +58,7 @@ eval { chanId => 119, ); }; -is( $@, '', 'set_fields, second value' ); +is( $@, q{}, 'set_fields, second value' ); like( $mech->uri, qr/chanId=119/, '... and the second value was set'); @@ -70,7 +70,7 @@ eval { } ); }; -is( $@, '', 'submit_form, second value as array' ); +is( $@, q{}, 'submit_form, second value as array' ); like( $mech->uri, qr/chanId=119/, '... and the second value was set'); @@ -81,7 +81,7 @@ eval { ); $mech->submit; }; -is( $@, '', 'field, second value' ); +is( $@, q{}, 'field, second value' ); like( $mech->uri, qr/chanId=119/, '... and the second value was set'); @@ -92,7 +92,7 @@ eval { ); $mech->submit; }; -is( $@, '', 'field, second value as array' ); +is( $@, q{}, 'field, second value as array' ); like( $mech->uri, qr/chanId=119/, '... and the second value was set'); @@ -104,7 +104,7 @@ eval { } ); }; -is( $@, '', 'submit_form, first value' ); +is( $@, q{}, 'submit_form, first value' ); like( $mech->uri, qr/chanId=130/, '... and the first value was set'); diff --git a/t/local/submit.t b/t/local/submit.t index daecb65..22ff414 100644 --- a/t/local/submit.t +++ b/t/local/submit.t @@ -25,7 +25,7 @@ is( $mech->uri, $server->url, 'Got the correct page' ); ok( $response->is_success, 'Got local page' ) or die 'cannot even fetch local page'; ok( $mech->is_html, 'is HTML' ); -is( $mech->value('upload'), '', 'Hopefully no upload happens'); +is( $mech->value('upload'), q{}, 'Hopefully no upload happens'); $mech->field(query => 'foo'); # Filled the 'q' field @@ -35,7 +35,7 @@ ok( $response->is_success, 'Can click "submit" ("submit" button)'); like($mech->content, qr/\bfoo\b/i, 'Found "Foo"'); -is( $mech->value('upload'), '', 'No upload happens' ); +is( $mech->value('upload'), q{}, 'No upload happens' ); SKIP: { skip 'Test::Memory::Cycle not installed', 1 unless $canTMC; diff --git a/t/mech-dump/file_not_found.t b/t/mech-dump/file_not_found.t index 262d01e..90b0587 100644 --- a/t/mech-dump/file_not_found.t +++ b/t/mech-dump/file_not_found.t @@ -4,7 +4,7 @@ use warnings; use strict; use Test::More; -use Test::Output qw(output_like); +use Test::Output qw( output_like ); use File::Spec (); # See https://stackoverflow.com/a/32054866/1331451 diff --git a/t/regex-error.t b/t/regex-error.t index 928a040..8c791ab 100644 --- a/t/regex-error.t +++ b/t/regex-error.t @@ -4,18 +4,18 @@ use warnings; use strict; use Test::More; -use Test::Warn qw( warning_like ); +use Test::Warnings qw(:all); use WWW::Mechanize (); my $m = WWW::Mechanize->new; isa_ok( $m, 'WWW::Mechanize' ); -warning_like { +like warning { $m->find_link( link_regex => 'foo' ); -} qr[Unknown link-finding parameter "link_regex".+line \d+], 'Passes message, and includes the line number'; +}, qr[Unknown link-finding parameter "link_regex".+line \d+], 'Passes message, and includes the line number'; -warning_like { +like warning { $m->find_link( url_regex => 'foo' ); -} qr[foo passed as url_regex is not a regex.+line \d+], 'Passes message, and includes the line number'; +}, qr[foo passed as url_regex is not a regex.+line \d+], 'Passes message, and includes the line number'; done_testing(); diff --git a/t/save_content.t b/t/save_content.t index b4f4a4f..a355b91 100644 --- a/t/save_content.t +++ b/t/save_content.t @@ -7,7 +7,6 @@ use Test::More tests => 8; use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -54,5 +53,5 @@ sub slurp { my $name = shift; open( my $fh, '<', $name ) or die "Can't open $name: $!\n"; - return join '', <$fh>; + return join q{}, <$fh>; } @@ -2,11 +2,11 @@ use warnings; use strict; -use Test::More tests => 14; +use Test::More; +use Test::Warn qw( warning_like ); use URI::file (); BEGIN { - delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); } @@ -33,19 +33,23 @@ $form = $mech->current_form(); # Multi-select # pass multiple values to a multi select +$form->param('multilist', undef); $mech->select('multilist', \@sendmulti); @return = $form->param('multilist'); is_deeply(\@return, \@sendmulti, 'multi->multi value is ' . join(' ', @return)); +$form->param('multilist', undef); $mech->select('multilist', \%sendmulti); @return = $form->param('multilist'); is_deeply(\@return, \@sendmulti, 'multi->multi value is ' . join(' ', @return)); # pass a single value to a multi select +$form->param('multilist', undef); $mech->select('multilist', $sendsingle); $return = $form->param('multilist'); is($return, $sendsingle, "single->multi value is '$return'"); +$form->param('multilist', undef); $mech->select('multilist', \%sendsingle); $return = $form->param('multilist'); is($return, $sendsingle, "single->multi value is '$return'"); @@ -54,20 +58,24 @@ is($return, $sendsingle, "single->multi value is '$return'"); # Single select # pass multiple values to a single select (only the _first_ should be set) +$form->param('singlelist', undef); $mech->select('singlelist', \@sendmulti); @return = $form->param('singlelist'); is_deeply(\@return, \@singlereturn, 'multi->single value is ' . join(' ', @return)); +$form->param('singlelist', undef); $mech->select('singlelist', \%sendmulti); @return = $form->param('singlelist'); is_deeply(\@return, \@singlereturn, 'multi->single value is ' . join(' ', @return)); # pass a single value to a single select +$form->param('singlelist', undef); $rv = $mech->select('singlelist', $sendsingle); $return = $form->param('singlelist'); is($return, $sendsingle, "single->single value is '$return'"); +$form->param('singlelist', undef); $rv = $mech->select('singlelist', \%sendsingle); $return = $form->param('singlelist'); is($return, $sendsingle, "single->single value is '$return'"); @@ -75,8 +83,8 @@ is($return, $sendsingle, "single->single value is '$return'"); # test return value from $mech->select is($rv, 1, 'return 1 after successful select'); -EAT_THE_WARNING: { # Mech complains about the non-existent field - local $SIG{__WARN__} = sub {}; - $rv = $mech->select('missing_list', 1); -} -is($rv, undef, 'return undef after failed select'); +warning_like { $rv = $mech->select( 'missing_list', 1 ) } qr/not found/, + 'warning when field is not found'; +is( $rv, undef, 'return undef after failed select' ); + +done_testing; @@ -7,7 +7,6 @@ use Test::Fatal qw( exception ); use Test::More; use URI::file (); -delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Placates taint-unsafe Cwd.pm in 5.6.1 use_ok( 'WWW::Mechanize' ); my $mech = WWW::Mechanize->new( cookie_jar => undef ); @@ -22,7 +21,7 @@ $mech->tick('foo','hello'); $mech->tick('foo','bye'); $mech->untick('foo','hello'); -$mech->tick('no_value', ''); +$mech->tick('no_value', q{}); my $form = $mech->form_number(1); isa_ok( $form, 'HTML::Form' ); @@ -3,26 +3,26 @@ use warnings; use strict; -use Test::Warn qw( warning_like ); +use Test::Warnings qw( :all ); use Test::More; use WWW::Mechanize (); my $m = WWW::Mechanize->new; isa_ok( $m, 'WWW::Mechanize' ); -warning_like { +like warning { $m->warn( 'Something bad' ); -} qr[Something bad.+line \d+], 'Passes the message, and includes the line number'; +}, qr[Something bad.+line \d+], 'Passes the message, and includes the line number'; -warning_like { +is join('', warnings { $m->quiet(1); $m->warn( 'Something bad' ); -} undef, 'Quiets correctly'; +}), '', 'Quiets correctly'; my $hushed = WWW::Mechanize->new( quiet => 1 ); isa_ok( $hushed, 'WWW::Mechanize' ); -warning_like { +is join('', warnings { $hushed->warn( 'Something bad' ); -} undef, 'Quiets correctly'; +}), '', 'Quiets correctly'; done_testing(); diff --git a/t/warnings.t b/t/warnings.t index 77860ba..0bb6167 100644 --- a/t/warnings.t +++ b/t/warnings.t @@ -4,16 +4,16 @@ use warnings; use strict; use Test::More; -use Test::Warn qw( warning_is ); +use Test::Warnings qw( :all ); use WWW::Mechanize (); UNKNOWN_ALIAS: { my $m = WWW::Mechanize->new; isa_ok( $m, 'WWW::Mechanize' ); - warning_is { + like warning { $m->agent_alias( 'Blongo' ); - } 'Unknown agent alias "Blongo"', 'Unknown aliases squawk appropriately'; + }, qr/\AUnknown agent alias "Blongo"/, 'Unknown aliases squawk appropriately'; } done_testing(); diff --git a/xt/author/live/wikipedia.t b/xt/author/live/wikipedia.t index 0ae7164..ba66f3e 100644 --- a/xt/author/live/wikipedia.t +++ b/xt/author/live/wikipedia.t @@ -13,7 +13,7 @@ use WWW::Mechanize (); use lib 't'; BEGIN { - use Tools; + use Tools qw( $canTMC memory_cycle_ok ); } my $mech = WWW::Mechanize->new; diff --git a/xt/author/portability.t b/xt/author/portability.t index c531252..6d1d92d 100644 --- a/xt/author/portability.t +++ b/xt/author/portability.t @@ -3,8 +3,6 @@ use warnings; use Test::More; -eval 'use Test::Portability::Files'; -plan skip_all => 'Test::Portability::Files required for testing portability' - if $@; +use Test::Portability::Files; run_tests(); |