diff -Nru libwww-mechanize-shell-perl-0.57/Changes libwww-mechanize-shell-perl-0.58/Changes --- libwww-mechanize-shell-perl-0.57/Changes 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/Changes 2019-09-30 08:03:13.000000000 +0000 @@ -1,256 +1,261 @@ Revision history for Perl extension WWW::Mechanize::Shell. Todo: - + Think about HTML::FillInForm for displaying changed form values interactively - + Check how the new WWW::Mechanize JavaScript handling interacts with the - shells own JS blocking (badly, I guess) - + Use Scalar::Util::weaken if available - + Think how to add other (Xpath) extractions to conveniently - display stuff via CSS selectors or XPath selectors. Steal - from Web::Scraper. - + There is a memory leak between ::FormFiller and ::Shell - + Ditch Hook::LexWrap now that LWP::UserAgent has progress callbacks - + Add set-cookie and delete-cookie commands - + Add (optional) HTTP::Cookies::Find support - -0.57 20180604 - + Add "images" command to list all images - + Allow other user agent objects like WWW::Mechanize::Chrome + * Think about HTML::FillInForm for displaying changed form values interactively + * Check how the new WWW::Mechanize JavaScript handling interacts with the + shells own JS blocking (badly, I guess) + * Use Scalar::Util::weaken if available + * Think how to add other (Xpath) extractions to conveniently + display stuff via CSS selectors or XPath selectors. Steal + from Web::Scraper. + * There is a memory leak between ::FormFiller and ::Shell + * Ditch Hook::LexWrap now that LWP::UserAgent has progress callbacks + * Add set-cookie and delete-cookie commands + * Add (optional) HTTP::Cookies::Find support + +0.58 2019-09-30 + * Made the tests pass on IPv6 enabled systems + Uncovered by making Test::HTTP::LocalServer work on IPv6 enabled systems. + * Test-only improvements, no need to upgrade + +0.57 2018-06-04 + * Add "images" command to list all images + * Allow other user agent objects like WWW::Mechanize::Chrome Use it from the command line as perl -Ilib -MWWW::Mechanize::Chrome \ - -MWWW::Mechanize::Shell \ - -e"shell(agent => WWW::Mechanize::Chrome->new())" + -MWWW::Mechanize::Shell \ + -e"shell(agent => WWW::Mechanize::Chrome->new())" -0.56 20170425 - + Send uncompressed output to the browser +0.56 2017-04-25 + * Send uncompressed output to the browser (contributed by weltonrodrigo) - + Fix some warnings caused by links without a text - . Fix test suite due to newer version of Test::Without::Module - . Upgrade the test HTTP server to work in absence of CGI.pm - -0.55 20150426 - . Fix one more test against new sprintf() warnings in 5.21+ - -0.54 20150426 - . Fix test suite against new sprintf() warnings in 5.21+ - . Fix test suite against calling CGI::param in list context + * Fix some warnings caused by links without a text + * Fix test suite due to newer version of Test::Without::Module + * Upgrade the test HTTP server to work in absence of CGI.pm + +0.55 2015-04-26 + * Fix one more test against new sprintf() warnings in 5.21+ + +0.54 2015-04-26 + * Fix test suite against new sprintf() warnings in 5.21+ + * Fix test suite against calling CGI::param in list context Both analyzed and contributed by Slaven Rezic -0.53 20130810 - . Add links to repository, contributed by D. Steinbrunner +0.53 2013-08-10 + * Add links to repository, contributed by D. Steinbrunner -0.52 20110106 - . Fix stupid thinko in test (only affects tests on 5.13+) +0.52 2011-01-06 + * Fix stupid thinko in test (only affects tests on 5.13+) -0.51 20110105 - . Make a test more robust against 5.14 - . Streamlined Exporter.pm usage - . Rely on parent.pm instead of base.pm - . No need to upgrade +0.51 2011-01-05 + * Make a test more robust against 5.14 + * Streamlined Exporter.pm usage + * Rely on parent.pm instead of base.pm + * No need to upgrade -0.50 20100821 - . Remove test file that was just testing LWP functionality and that +0.50 2010-08-21 + * Remove test file that was just testing LWP functionality and that failed for some weird setups where nonexistent hosts still result in a successful HTTP request. - . Added links to repositories + * Added links to repositories -0.49 20100817 - + Apply [rt.cpan.org #59246] , +0.49 2010-08-17 + * Apply [rt.cpan.org #59246] , thanks to Ansgar Burchardt This fixes another case where API changes in LWP weren't mirrored by this module. - + Fix t/14-command-identity.t to not make an external request anymore + * Fix t/14-command-identity.t to not make an external request anymore Addresses [rt.cpan.org #59883] -0.48 20081109 - + More test fixes for incompatibilities between LWP and Mechanize 1.34+ - + Removed way to set up authentication for more than one site - . WWW::Mechanize monkeypatches LWP::UserAgent and thus you can only ever +0.48 2008-11-09 + * More test fixes for incompatibilities between LWP and Mechanize 1.34+ + * Removed way to set up authentication for more than one site + * WWW::Mechanize monkeypatches LWP::UserAgent and thus you can only ever have one set of user/password in your script. -0.47 20081102 - + Fix tests to work with libwww 5.815+ which automatically retries +0.47 2008-11-02 + * Fix tests to work with libwww 5.815+ which automatically retries with empty user/password - + WWW::Mechanize 1.34+ breaks Basic authentication with LWP 5.815+ + * WWW::Mechanize 1.34+ breaks Basic authentication with LWP 5.815+ so all auth tests are skipped until Andy Lester and Gisle Aas work out who has to fix their stuff. - . Hook::LexWrap is subject to bug [perl #46217], this might + * Hook::LexWrap is subject to bug [perl #46217], this might cause problems if you're running Perl 5.10.0. All tests pass. -0.46 20071003 - + Bump version because of borked CPAN upload, retrying +0.46 2007-10-03 + * Bump version because of borked CPAN upload, retrying * No need to upgrade -0.45 20071003 +0.45 2007-10-03 * No library code changes, no need to upgrade - - Removed HTML::Display from the distribution + * Removed HTML::Display from the distribution as that now lives its own life on CPAN - - Fix failing tests if HTTP_PROXY was set. This fixes + * Fix failing tests if HTTP_PROXY was set. This fixes Debian bug #444634, http://bugs.debian.org/444634 and CPAN RT #29455, thanks to Niko Tyni -0.44 20070707 +0.44 2007-07-07 - + Added C and C<headers> commands that print out + * Added C<title> and C<headers> commands that print out the title and headers of the page. Suggested by Ed Halley. - + Added and documented arguments to the C<< shell >> subroutine - + Quieted up some test warnings - + IO::Catch now understands C<printf> - + Upgrade to Term::Shell v0.02 which now displays the help + * Added and documented arguments to the C<< shell >> subroutine + * Quieted up some test warnings + * IO::Catch now understands C<printf> + * Upgrade to Term::Shell v0.02 which now displays the help summary better. -0.43 20070511 - - fix failures on 5.6.2 with a B::Deparse version that doesn't +0.43 2007-05-11 + * fix failures on 5.6.2 with a B::Deparse version that doesn't support ->ambient_pragmas() - they get ignored there now. 0.42 200704.. - - Test fixes only, no need to upgrade - - Patches submitted by MAREKR (RT #26397) and somebody else whose + * Test fixes only, no need to upgrade + * Patches submitted by MAREKR (RT #26397) and somebody else whose name I cannot find, sorry. - - Delete some more proxy settings for the test runs + * Delete some more proxy settings for the test runs -0.41 20070414 - - Codeacrobat release - - Restore compatibility with WWW::Mechanize 1.22 +0.41 2007-04-14 + * Codeacrobat release + * Restore compatibility with WWW::Mechanize 1.22 Thanks to Jörg Meltzer who sent in the patch -0.40 20070117 - - Fixed showstopper bug in prompt method that was hidden +0.40 2007-01-17 + * Fixed showstopper bug in prompt method that was hidden by all tests disabling interactive prompts Thanks to all reporters 0.39 - - Bumped module version - - Fix for RT 22121 - shell does not start + * Bumped module version + * Fix for RT 22121 - shell does not start -0.38 20061214 - - Bumped module version - - Added a test for HTML::TableExtract functionality +0.38 2006-12-14 + * Bumped module version + * Added a test for HTML::TableExtract functionality which went untested so far - - Fixed HTML::TableExtract functionality + * Fixed HTML::TableExtract functionality This functionality now requires HTML::TableExtract 2.0 or higher, sorry - - This release now needs WWW::Mechanize 1.20, for the update_html + * This release now needs WWW::Mechanize 1.20, for the update_html method which is used in the tests. Sorry. - - Reworked code generation and code execution - - ! Think about plugins for other extractions: + * Reworked code generation and code execution + * ! Think about plugins for other extractions: * Template::Extract * XML::XPath extractions - - Think about using a different shell framework provider + * Think about using a different shell framework provider 0.37 - - Fixed bug that created invalid code for the C<auth> command + * Fixed bug that created invalid code for the C<auth> command 0.36 - - Fixed the actual bug too. + * Fixed the actual bug too. 0.35 - - Fixed documentation in HTML::Display::Debian about C<x-www-browser>. + * Fixed documentation in HTML::Display::Debian about C<x-www-browser>. 0.34 - - Fixed a bug where C<form 2> resulted in an error. Now selecting a form by + * Fixed a bug where C<form 2> resulted in an error. Now selecting a form by number actually works. Thanks for the report via RT. 0.33 - - The C<form> command now got a life of its own instead of being a lazy abbreviation + * The C<form> command now got a life of its own instead of being a lazy abbreviation of the C<forms> command. It takes a form name or form number. 0.32 - - now WWW::Mechanize::Shell directly uses HTML::TokeParser::Simple. Previously, + * now WWW::Mechanize::Shell directly uses HTML::TokeParser::Simple. Previously, it was only needed for special cases of HTML::Display. - - WWW::Mechanize::Shell now strips all "target" attributes from your HTML. + * WWW::Mechanize::Shell now strips all "target" attributes from your HTML. 0.31 - - test t/13* didn't work when the CPAN build directory contains a space - - Added patch by Philippe "BooK" Bruhat to allow downloading big files + * test t/13* didn't work when the CPAN build directory contains a space + * Added patch by Philippe "BooK" Bruhat to allow downloading big files directly to disk. Changed behaviour: - - The referrer header now always points to the original page you save from + * The referrer header now always points to the original page you save from when using the C<save> command. 0.30 - - Now needs the latest? Test::Harness because otherwise some tests failed + * Now needs the latest? Test::Harness because otherwise some tests failed from time to time for no apparent reason. - - using Devel::Cover. Code coverage of WWW/Mechanize/Shell.pm is now at 75.00% + * using Devel::Cover. Code coverage of WWW/Mechanize/Shell.pm is now at 75.00% through the test suite - - Provide better text for all links (for example when the content is an image) - - Now moved to use WWW::Mechanize::Link instead of direct array access - - This means it requires WWW::Mechanize 0.57 or higher - - added "comment" command, which allows to add comments to both, the shell + * Provide better text for all links (for example when the content is an image) + * Now moved to use WWW::Mechanize::Link instead of direct array access + * This means it requires WWW::Mechanize 0.57 or higher + * added "comment" command, which allows to add comments to both, the shell script and the generated script. (Donated by Alexander Goller) - - accomodated for most recent version of LWP, which dosen't die on failing host + * accomodated for most recent version of LWP, which dosen't die on failing host lookups but returns error 500. 0.29 - - Fixed bug when autocompletion did crash the shell (S. Rezic) - - HTML::Display::Opera does not open a new window anymore (S. Rezic) - - Moved private package "Catch" to IO::Catch and made all tests use that package + * Fixed bug when autocompletion did crash the shell (S. Rezic) + * HTML::Display::Opera does not open a new window anymore (S. Rezic) + * Moved private package "Catch" to IO::Catch and made all tests use that package 0.28 - - Add $PAGER support for multiline output - - "referer" command now prints the old referer if no new value is given - - added RT bug email address to documentation + * Add $PAGER support for multiline output + * "referer" command now prints the old referer if no new value is given + * added RT bug email address to documentation 0.27 - - now needs WWW::Mechanize 0.47 - - added "tick" and "untick" commands (plus tests) - - fixed t/14*.t so that now the correct locations are used - - removed ::Unwrap class that was not used anywhere - - If more than one value is passed to the "value" command, the parameters + * now needs WWW::Mechanize 0.47 + * added "tick" and "untick" commands (plus tests) + * fixed t/14*.t so that now the correct locations are used + * removed ::Unwrap class that was not used anywhere + * If more than one value is passed to the "value" command, the parameters are concatenated with spaces - - added test that all released files are in Unix text format - - added "dumpresponses" option - - added "verbose" option that prints the commands while sourcing a file (Prakash Kailasa) - - "content" now can save the content to a file (Prakash Kailasa) - - added "ct" command to print the Context-Type header (Prakash Kailasa) - - added "referer" and "referrer" command to change the Referer header (Prakash Kailasa) - - added "timeout" command to set the LWP::UserAgent timeout (Prakash Kailasa) - - added "response" command to display the complete response (request by Mark Stosberg) - - updated tests to accomodate for the new commands + * added test that all released files are in Unix text format + * added "dumpresponses" option + * added "verbose" option that prints the commands while sourcing a file (Prakash Kailasa) + * "content" now can save the content to a file (Prakash Kailasa) + * added "ct" command to print the Context-Type header (Prakash Kailasa) + * added "referer" and "referrer" command to change the Referer header (Prakash Kailasa) + * added "timeout" command to set the LWP::UserAgent timeout (Prakash Kailasa) + * added "response" command to display the complete response (request by Mark Stosberg) + * updated tests to accomodate for the new commands 0.26 - - added RE support to autofill - - fixed broken HTML display as the filename was passed doubled - - POD fixes - - HTML::Display now checks for @ISA before loading a file - - Displaying shared files is now tested against - - Updated POD to reflect the new RE parsing + * added RE support to autofill + * fixed broken HTML display as the filename was passed doubled + * POD fixes + * HTML::Display now checks for @ISA before loading a file + * Displaying shared files is now tested against + * Updated POD to reflect the new RE parsing 0.25 - - The "versions" command also lists HTML::Display now - - hunted down and fixed error in skipping too many tests in t/01-Win32-OLE-fallback.t - - fixed redefinition warning in t/00-use.t - - updated local server tests + * The "versions" command also lists HTML::Display now + * hunted down and fixed error in skipping too many tests in t/01-Win32-OLE-fallback.t + * fixed redefinition warning in t/00-use.t + * updated local server tests 0.24 - fixup release for 0.23 - - Added $VERSION to all HTML::Display modules - - patched handing of BASE tags, so that more cases are caught. + * Added $VERSION to all HTML::Display modules + * patched handing of BASE tags, so that more cases are caught. This adds HTML::TokeParser::Simple as a prerequisite. Thanks to Mark Stosberg for the initial patch! - - fixed loading of classes in HTML::Display. Classes are only required + * fixed loading of classes in HTML::Display. Classes are only required if there is no method "display_html" in that namespace already. - - fixed embarassing Linux compatibility bugs - - HTML::Display::TempFile now also works under Windows where sharing did not + * fixed embarassing Linux compatibility bugs + * HTML::Display::TempFile now also works under Windows where sharing did not allow another process to read the file while it was being written 0.23 - - "submit" didn't reload the browser HTML. Thanks to Slaven Rezic. - - t/14* now skips instead of fails tests that can't succeed. - - fixed test failing if Term::ReadKey was not available - - fixed synopsis code not reading the .mechanizerc - - made WWW::Mechanize::Shell use the "reload" method of WWW::Mechanize + * "submit" didn't reload the browser HTML. Thanks to Slaven Rezic. + * t/14* now skips instead of fails tests that can't succeed. + * fixed test failing if Term::ReadKey was not available + * fixed synopsis code not reading the .mechanizerc + * made WWW::Mechanize::Shell use the "reload" method of WWW::Mechanize (after all, I asked for that method ...) - - Test for multivalues added, but it's not testing the right stuff yet + * Test for multivalues added, but it's not testing the right stuff yet (see https://rt.cpan.org/Ticket/Display.html?id=2700 ). Not in MANIFEST and/or distribution, but the Changes file is also for me :-) - - clarified documentation about "watchfiles" and "autoreload" (thanks to + * clarified documentation about "watchfiles" and "autoreload" (thanks to Mark Stosberg) - - Documentation fixes for "open" and "links" (also courtesy of Mark Stosberg) - - The dumprequests feature needs Hook::LexWrap - it didn't work + * Documentation fixes for "open" and "links" (also courtesy of Mark Stosberg) + * The dumprequests feature needs Hook::LexWrap - it didn't work properly before. The feature is tested in t/14 - - "restart" in a -e oneliner dosen't crash the shell (it also dosen't restart though) - - factored out the HTML display into a module of its own (HTML::Display), + * "restart" in a -e oneliner dosen't crash the shell (it also dosen't restart though) + * factored out the HTML display into a module of its own (HTML::Display), distributed with this. This breaks existing setups, as the "browsercmd" and "useole" option disappeared. You can configure the used browser class by setting the environment variable PERL_HTML_DISPLAY_CLASS @@ -262,145 +267,145 @@ Please also tell me whether HTML::Display would be worth a release on its own! 0.22 - - The module now requires WWW::Mechanize v0.43, as the internal + * The module now requires WWW::Mechanize v0.43, as the internal API of WWW::Mechanize changed. Mixing W::M::S 0.21 or below with W::M v0.43+ will not work as will mixing W::M::S 0.22+ with W::M v0.41- - - Added new command "reload", which repeats the last request + * Added new command "reload", which repeats the last request (intended for testing/modifying server side code) - - Altered fillout command - now _all_ fields that aren't predefined + * Altered fillout command - now _all_ fields that aren't predefined via an "autofill" command get asked interactively. Previously fields that already had a value weren't asked. This means that you maybe have to rewrite parts of your scripts if you are using the shell as a testing tool. See t/14* and t/16* for scripts that redefine the interactive asking method to something noninteractive. Field types that do not get asked are : hidden,submit - - The "eval" command now takes multiline strings. This is not interesting + * The "eval" command now takes multiline strings. This is not interesting if you're using the plain shell, as the readline shell dosen't know about about multiline strings, but if you're using the $shell->cmd() feature, it's handy to split your evals over more than one line. 0.21 - - Fixed error in one-liner usage - - Fixed embarassing errors in 'forms' and 'save' commands - - other documentation fixes - - The history can now be saved directly to a file - - The script can now be saved directly to a file - - The generated scripts now have a correct shebang line - - Fixed redirect behaviour in generated scripts - - Manually filled values (via 'fillout') now get created as 'value' commands + * Fixed error in one-liner usage + * Fixed embarassing errors in 'forms' and 'save' commands + * other documentation fixes + * The history can now be saved directly to a file + * The script can now be saved directly to a file + * The generated scripts now have a correct shebang line + * Fixed redirect behaviour in generated scripts + * Manually filled values (via 'fillout') now get created as 'value' commands 0.20 - - made t/00a*.t a TODO test so that CPAN install (silently) works - - updated documentation on how to specify custom callbacks from + * made t/00a*.t a TODO test so that CPAN install (silently) works + * updated documentation on how to specify custom callbacks from within the shell (having an interpreter with eval rules!) - - various documentation fixes - - fixed behaviour of "open" with regard to regular expressions - - extensive testing of shell behaviour regarding the navigation added - - Fixed t/06* when Test::MockObject is not installed + * various documentation fixes + * fixed behaviour of "open" with regard to regular expressions + * extensive testing of shell behaviour regarding the navigation added + * Fixed t/06* when Test::MockObject is not installed 0.19 - - Added t/00a*.t to check for a Term::Shell bug to the MANIFEST - - renamed the "history" command to "script" - - the new "history" command now outputs the "relevant" shell commands - - added "versions" command to print out the versions of the installed modules - - added "ua" command to easily change the user agent string - - added documentation for some more methods - - added understanding of "#" as a comment - - added a "save" command to save links into files - - added "auth" command for basic authentication (suggested by merlyn) - - added live test of the auth command against HTTP::Daemon (code provided by merlyn) - - added test that 'url' basic authentication also works (http://login:password@example.com) - - added convenience "shell" module method : + * Added t/00a*.t to check for a Term::Shell bug to the MANIFEST + * renamed the "history" command to "script" + * the new "history" command now outputs the "relevant" shell commands + * added "versions" command to print out the versions of the installed modules + * added "ua" command to easily change the user agent string + * added documentation for some more methods + * added understanding of "#" as a comment + * added a "save" command to save links into files + * added "auth" command for basic authentication (suggested by merlyn) + * added live test of the auth command against HTTP::Daemon (code provided by merlyn) + * added test that 'url' basic authentication also works (http://login:password@example.com) + * added convenience "shell" module method : perl -MWWW::Mechanize::Shell -e "shell" - - added full end-to-end testing for many commands and their generated scripts - - fixed many bugs in the generated scripts - - many documentation fixes - - Term::ReadLine now gets disabled for the tests - - silenced HTML::Form warning for readonly fields + * added full end-to-end testing for many commands and their generated scripts + * fixed many bugs in the generated scripts + * many documentation fixes + * Term::ReadLine now gets disabled for the tests + * silenced HTML::Form warning for readonly fields 0.18 - - No functional changes to v0.17 - - Discovered that and documented how file uploads work - - Added BUGS section to documentation + * No functional changes to v0.17 + * Discovered that and documented how file uploads work + * Added BUGS section to documentation 0.17 - - Fixed a doc bug where "exit" referred to the (nonexistent) "quit" topic (thanks Mark) - - Made a test checking the version of Term::Shell and the help summary bug - - Fixed t/06*.t - it crashed when Test::MockObject wasn't installed + * Fixed a doc bug where "exit" referred to the (nonexistent) "quit" topic (thanks Mark) + * Made a test checking the version of Term::Shell and the help summary bug + * Fixed t/06*.t - it crashed when Test::MockObject wasn't installed -0.16 20030429 - - Changed double quotes around parameters to single quotes +0.16 2003-04-29 + * Changed double quotes around parameters to single quotes to allow for urls like http://mark@foo.com (thanks Mark) - - Added tests to check that created scripts at least compile - - Made the form fillout more robust by wrapping it in an eval block + * Added tests to check that created scripts at least compile + * Made the form fillout more robust by wrapping it in an eval block -0.14 20030414 - - Fixed a bad list bug introduced with my unix-browser patch to the options system. Slaven Rezics +0.14 2003-04-14 + * Fixed a bad list bug introduced with my unix-browser patch to the options system. Slaven Rezics submitted patch had nothing to do with this, I only grabbed the idea from him but did botch the implementation myself. - - Added a test that all options can be set and reset - - Reenabled all warnings in the tests - - Removed one warning for an unavailable module - - Added first part of JavaScript handling : + * Added a test that all options can be set and reset + * Reenabled all warnings in the tests + * Removed one warning for an unavailable module + * Added first part of JavaScript handling : The shell detects when you want to follow a javascript: link, and says that you can't do that. -0.13 20030404 - - Slaven Rezic submitted a patch to enable synchronous HTML +0.13 2003-04-04 + * Slaven Rezic submitted a patch to enable synchronous HTML display under Unix ! Thanks go to Slaven !! All bugs/errors are my fault ! - - fixed a crash if the url to the get command was invalid - - fixed a crash if a browser was launched without a previous request - - added tests for those two crashes - - moved example shell from examples/shell.pl to bin/wwwshell.pl - -0.12 20030320 - - Added a test to check for the behaviour if HTML::TableExtract is not present - - silenced warnings in the tests - - No changes to the main module except for the version number + * fixed a crash if the url to the get command was invalid + * fixed a crash if a browser was launched without a previous request + * added tests for those two crashes + * moved example shell from examples/shell.pl to bin/wwwshell.pl + +0.12 2003-03-20 + * Added a test to check for the behaviour if HTML::TableExtract is not present + * silenced warnings in the tests + * No changes to the main module except for the version number -0.11 20030318 - - Updated the tests so they skip when there is no terminal available +0.11 2003-03-18 + * Updated the tests so they skip when there is no terminal available (as is the case when the tests are run from cron) - - Fixed the inline tests so the synopsis shows again + * Fixed the inline tests so the synopsis shows again -0.10 20030312 - - Added the "table" command to display/dump HTML tables using HTML::TableExtract - - Added "table" history - - Added tests for history - - Brought README file up to date with the suggested support modules - - Added example showing off tables - - Added proxy support to the shell and the produced scripts - - Added documentation on proxy - - Added table lister - -0.09 20030308 - - I should go back and use the web interface. It was made for people like me. - -0.08 20030308 - - third time's the charm +0.10 2003-03-12 + * Added the "table" command to display/dump HTML tables using HTML::TableExtract + * Added "table" history + * Added tests for history + * Brought README file up to date with the suggested support modules + * Added example showing off tables + * Added proxy support to the shell and the produced scripts + * Added documentation on proxy + * Added table lister + +0.09 2003-03-08 + * I should go back and use the web interface. It was made for people like me. + +0.08 2003-03-08 + * third time's the charm -0.07 20030308 - - And again, because I am stupid +0.07 2003-03-08 + * And again, because I am stupid -0.06 20030308 - - bumped version because I uploaded a partial file to CPAN ... +0.06 2003-03-08 + * bumped version because I uploaded a partial file to CPAN ... -0.05 20030307 - - Fixed the dependency on Win32::OLE - the module now handles other +0.05 2003-03-07 + * Fixed the dependency on Win32::OLE - the module now handles other environments gracefully - - Added some tests for the module fallbacks (these tests need Test::Without::Module) - - moved handling over to cvs + * Added some tests for the module fallbacks (these tests need Test::Without::Module) + * moved handling over to cvs -0.04 20030301 - - reupload as the 0.02 and 0.03 upload was broken +0.04 2003-03-01 + * reupload as the 0.02 and 0.03 upload was broken -0.02 20030228 - - Made the shell much more robust against wrong parameters and +0.02 2003-02-28 + * Made the shell much more robust against wrong parameters and internal failures. - - Open /foo/ now goes into the Perl code as "follow(/foo/)", + * Open /foo/ now goes into the Perl code as "follow(/foo/)", as it should be -0.01 Thu Nov 7 23:04:20 2002 - - original version; created by h2xs 1.21 with options - -X WWW::Mechanize::Shell +0.01 2002-11-07 + * original version; created by h2xs 1.21 with options + -X WWW::Mechanize::Shell diff -Nru libwww-mechanize-shell-perl-0.57/debian/changelog libwww-mechanize-shell-perl-0.58/debian/changelog --- libwww-mechanize-shell-perl-0.57/debian/changelog 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/changelog 2019-11-09 15:36:51.000000000 +0000 @@ -1,3 +1,18 @@ +libwww-mechanize-shell-perl (0.58-1) unstable; urgency=medium + + * Import upstream version 0.58. + * Update debian/upstream/metadata. + * Refresh spelling-errors patch. + * Update years of packaging copyright. + * Annotate test-only build dependencies with <!nocheck>. + * Declare compliance with Debian Policy 4.4.1. + * Drop unneeded alternative build dependencies. + * Bump debhelper-compat to 12. + * debian/watch: use uscan version 4. + * Add Makefile.PL to debian/tests/pkg-perl/smoke-files. + + -- gregor herrmann <gregoa@debian.org> Sat, 09 Nov 2019 16:36:51 +0100 + libwww-mechanize-shell-perl (0.57-1) unstable; urgency=medium [ Salvatore Bonaccorso ] @@ -82,7 +97,7 @@ [ Angel Abad ] * New upstream release * debian/copyright: Update license stanzas - * debian/control: Add perl (>= 5.10.1) | libparent-perl to + * debian/control: Add perl (>= 5.10.1) | libparent-perl to {Build-}Depends -- Angel Abad <angelabad@gmail.com> Fri, 07 Jan 2011 10:24:25 +0100 @@ -162,7 +177,7 @@ [ David Paleino ] * debian/control: removed myself from Uploaders - + [ Michael Mende ] * debian/control: Bumped Standards-Version to 3.7.3. diff -Nru libwww-mechanize-shell-perl-0.57/debian/compat libwww-mechanize-shell-perl-0.58/debian/compat --- libwww-mechanize-shell-perl-0.57/debian/compat 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -10 diff -Nru libwww-mechanize-shell-perl-0.57/debian/control libwww-mechanize-shell-perl-0.58/debian/control --- libwww-mechanize-shell-perl-0.57/debian/control 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/control 2019-11-09 15:36:51.000000000 +0000 @@ -7,27 +7,27 @@ Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 10) -Build-Depends-Indep: libcgi-pm-perl | perl (<< 5.19), - libhook-lexwrap-perl, - libhtml-display-perl, - libhtml-parser-perl, - libhtml-tableextract-perl, - libhtml-tokeparser-simple-perl, - libhttp-cookies-perl, - libpod-constants-perl, - libterm-shell-perl, - libtest-http-localserver-perl, - libtest-inline-perl, - libtest-mockobject-perl, - libtest-without-module-perl, - liburi-perl, - libwww-mechanize-formfiller-perl, - libwww-mechanize-perl, - libwww-perl, - netbase, +Build-Depends: debhelper-compat (= 12) +Build-Depends-Indep: libcgi-pm-perl <!nocheck>, + libhook-lexwrap-perl <!nocheck>, + libhtml-display-perl <!nocheck>, + libhtml-parser-perl <!nocheck>, + libhtml-tableextract-perl <!nocheck>, + libhtml-tokeparser-simple-perl <!nocheck>, + libhttp-cookies-perl <!nocheck>, + libpod-constants-perl <!nocheck>, + libterm-shell-perl <!nocheck>, + libtest-http-localserver-perl <!nocheck>, + libtest-inline-perl <!nocheck>, + libtest-mockobject-perl <!nocheck>, + libtest-without-module-perl <!nocheck>, + liburi-perl <!nocheck>, + libwww-mechanize-formfiller-perl <!nocheck>, + libwww-mechanize-perl <!nocheck>, + libwww-perl <!nocheck>, + netbase <!nocheck>, perl -Standards-Version: 4.1.4 +Standards-Version: 4.4.1 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libwww-mechanize-shell-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libwww-mechanize-shell-perl.git Homepage: https://metacpan.org/release/WWW-Mechanize-Shell @@ -54,6 +54,6 @@ session. Its main use is as an interactive starting point for automating a session through WWW::Mechanize. . - The cookie support is there, but no cookies are read from your existing + The cookie support is there, but no cookies are read from your existing browser sessions. See HTTP::Cookies on how to implement reading/writing your current browsers cookies. diff -Nru libwww-mechanize-shell-perl-0.57/debian/copyright libwww-mechanize-shell-perl-0.58/debian/copyright --- libwww-mechanize-shell-perl-0.57/debian/copyright 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/copyright 2019-11-09 15:36:51.000000000 +0000 @@ -10,7 +10,7 @@ Files: debian/* Copyright: 2007-2008, Michael Mende <debian@menole.net> 2007, 2015, Damyan Ivanov <dmn@debian.org> - 2009-2015, gregor herrmann <gregoa@debian.org> + 2009-2019, gregor herrmann <gregoa@debian.org> 2010-2011, 2017, Angel Abad <angel@debian.org> 2010, Ansgar Burchardt <ansgar@debian.org> License: Artistic or GPL-1+ diff -Nru libwww-mechanize-shell-perl-0.57/debian/patches/spelling-errors libwww-mechanize-shell-perl-0.58/debian/patches/spelling-errors --- libwww-mechanize-shell-perl-0.57/debian/patches/spelling-errors 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/patches/spelling-errors 2019-11-09 15:36:51.000000000 +0000 @@ -1,33 +1,34 @@ Description: Fix spelling errors -Author: Angel Abad <angel@debian.org> -Forwarded: yes Bug: https://rt.cpan.org/Public/Bug/Display.html?id=122377 -Last-Updated: 2018-06-20 +Forwarded: yes (not the current version) +Author: Angel Abad <angel@debian.org> +Reviewed-by: gregor herrmann <gregoa@debian.org> +Last-Update: 2019-11-09 --- a/Changes +++ b/Changes -@@ -179,7 +179,7 @@ - - This means it requires WWW::Mechanize 0.57 or higher - - added "comment" command, which allows to add comments to both, the shell +@@ -184,7 +184,7 @@ + * This means it requires WWW::Mechanize 0.57 or higher + * added "comment" command, which allows to add comments to both, the shell script and the generated script. (Donated by Alexander Goller) -- - accomodated for most recent version of LWP, which dosen't die on failing host -+ - accomodated for most recent version of LWP, which doesn't die on failing host +- * accomodated for most recent version of LWP, which dosen't die on failing host ++ * accomodated for most recent version of LWP, which doesn't die on failing host lookups but returns error 500. 0.29 -@@ -249,7 +249,7 @@ - - Documentation fixes for "open" and "links" (also courtesy of Mark Stosberg) - - The dumprequests feature needs Hook::LexWrap - it didn't work +@@ -254,7 +254,7 @@ + * Documentation fixes for "open" and "links" (also courtesy of Mark Stosberg) + * The dumprequests feature needs Hook::LexWrap - it didn't work properly before. The feature is tested in t/14 -- - "restart" in a -e oneliner dosen't crash the shell (it also dosen't restart though) -+ - "restart" in a -e oneliner doesn't crash the shell (it also doesn't restart though) - - factored out the HTML display into a module of its own (HTML::Display), +- * "restart" in a -e oneliner dosen't crash the shell (it also dosen't restart though) ++ * "restart" in a -e oneliner doesn't crash the shell (it also doesn't restart though) + * factored out the HTML display into a module of its own (HTML::Display), distributed with this. This breaks existing setups, as the "browsercmd" and "useole" option disappeared. You can configure the used browser -@@ -275,7 +275,7 @@ +@@ -280,7 +280,7 @@ the interactive asking method to something noninteractive. Field types that do not get asked are : hidden,submit - - The "eval" command now takes multiline strings. This is not interesting + * The "eval" command now takes multiline strings. This is not interesting - if you're using the plain shell, as the readline shell dosen't know about + if you're using the plain shell, as the readline shell doesn't know about about multiline strings, but if you're using the $shell->cmd() feature, @@ -35,7 +36,7 @@ --- a/README.mkdn +++ b/README.mkdn -@@ -133,7 +133,7 @@ +@@ -134,7 +134,7 @@ Restart the shell. @@ -44,7 +45,7 @@ work if you use the shell in oneliner mode with `-e`. ## get -@@ -607,7 +607,7 @@ +@@ -608,7 +608,7 @@ want to fill out forms using custom Perl code, here is a recipe how to achieve this : diff -Nru libwww-mechanize-shell-perl-0.57/debian/tests/pkg-perl/smoke-files libwww-mechanize-shell-perl-0.58/debian/tests/pkg-perl/smoke-files --- libwww-mechanize-shell-perl-0.57/debian/tests/pkg-perl/smoke-files 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/tests/pkg-perl/smoke-files 2019-11-09 15:36:51.000000000 +0000 @@ -1,3 +1,4 @@ t/ bin/ inc/ +Makefile.PL diff -Nru libwww-mechanize-shell-perl-0.57/debian/upstream/metadata libwww-mechanize-shell-perl-0.58/debian/upstream/metadata --- libwww-mechanize-shell-perl-0.57/debian/upstream/metadata 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/upstream/metadata 2019-11-09 15:36:51.000000000 +0000 @@ -1,5 +1,4 @@ --- Archive: CPAN -Contact: Max Maischein <corion@cpan.org> -Name: WWW-Mechanize-Shell -Repository: https://github.com/Corion/WWW-Mechanize-Shell +Repository: https://github.com/Corion/WWW-Mechanize-Shell.git +Repository-Browse: https://github.com/Corion/WWW-Mechanize-Shell diff -Nru libwww-mechanize-shell-perl-0.57/debian/watch libwww-mechanize-shell-perl-0.58/debian/watch --- libwww-mechanize-shell-perl-0.57/debian/watch 2018-07-02 17:43:22.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/debian/watch 2019-11-09 15:36:51.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 -https://metacpan.org/release/WWW-Mechanize-Shell .*/WWW-Mechanize-Shell-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) +version=4 +https://metacpan.org/release/WWW-Mechanize-Shell .*/WWW-Mechanize-Shell-v?@ANY_VERSION@@ARCHIVE_EXT@$ diff -Nru libwww-mechanize-shell-perl-0.57/.gitignore libwww-mechanize-shell-perl-0.58/.gitignore --- libwww-mechanize-shell-perl-0.57/.gitignore 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/.gitignore 2019-09-30 08:03:13.000000000 +0000 @@ -1,12 +1,16 @@ -Makefile -Makefile.old -*.tar.gz -*.bak -pm_to_blib -blib/ -WWW-Mechanize-Shell-* -WWW-Mechanize-Shell-*/ -.releaserc -.lwpcookies -CVS -MYMETA.* +Makefile +Makefile.old +*.tar.gz +*.bak +*.swp +pm_to_blib +blib/ +WWW-Mechanize-Shell-* +WWW-Mechanize-Shell-*/ +.lwpcookies +.releaserc +MYMETA.* +*.pl +.prove +.patch +CVS/ diff -Nru libwww-mechanize-shell-perl-0.57/inc/IO/Catch.pm libwww-mechanize-shell-perl-0.58/inc/IO/Catch.pm --- libwww-mechanize-shell-perl-0.57/inc/IO/Catch.pm 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/inc/IO/Catch.pm 2019-09-30 08:03:13.000000000 +0000 @@ -14,7 +14,7 @@ =head1 SYNOPSIS # pre-5.8.0's warns aren't caught by a tied STDERR. - use vars qw($_STDOUT_, $_STDERR_); + our ($_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; @@ -23,9 +23,7 @@ =cut -use vars qw($VERSION); - -$VERSION = '0.02'; +our $VERSION = '0.02'; sub TIEHANDLE { my($class, $var) = @_; diff -Nru libwww-mechanize-shell-perl-0.57/lib/WWW/Mechanize/Shell.pm libwww-mechanize-shell-perl-0.58/lib/WWW/Mechanize/Shell.pm --- libwww-mechanize-shell-perl-0.57/lib/WWW/Mechanize/Shell.pm 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/lib/WWW/Mechanize/Shell.pm 2019-09-30 08:03:13.000000000 +0000 @@ -15,7 +15,7 @@ use HTML::TokeParser::Simple; use B::Deparse; -our $VERSION = '0.57'; +our $VERSION = '0.58'; our @EXPORT = qw( &shell ); =head1 NAME @@ -140,8 +140,8 @@ $self->{redirect_ok_wrapper} = wrap 'WWW::Mechanize::redirect_ok', post => sub { return unless $_[1]; - $self->status( "\nRedirecting to ".$_[1]->uri."\n" ); - $_[-1] + $self->status( "\nRedirecting to ".$_[1]->uri."\n" ); + $_[-1] }; # Load the proxy settings from the environment @@ -707,7 +707,7 @@ Prints all C<< <H1> >> through C<< <H5> >> strings found in the content, indented accordingly. With an argument, prints only those -levels; e.g., C<headers 145> prints H1,H4,H5 strings only. +levels; e.g., C<headers 145> prints H1,H4,H5 strings only. =cut @@ -1144,7 +1144,7 @@ my $re = $link if ref $link; my $count = -1; my @possible_links = $self->agent->links(); - my @links = defined $re + my @links = defined $re ? map { $count++; my $t = $_->text; defined $t && $t =~ /$re/ ? $count : () } @possible_links : map { $count++; my $t = $_->text; defined $t && $t eq $link ? $count : () } @possible_links; if (@links > 1) { @@ -1449,8 +1449,8 @@ }; $code->(); my $body = $self->munge_code($code); - - $self->add_history( + + $self->add_history( "require HTML::TableExtract;\n", sprintf( 'my @columns = ( %s );'."\n", join( ",", map( { s/(['\\])/\\$1/g; qq('$_') } @columns ))), $body @@ -1617,8 +1617,8 @@ return }; print join "", @res,"\n"; - - + + my $script_code = $self->munge_code(qq{print $code, "\\n";}); #warn "Script: $script_code<<"; $self->add_history( $script_code ); @@ -1784,7 +1784,7 @@ sub munge_code { my ($self, $code) = @_; my $body; - + if (ref $code) { # Munge code my $d = B::Deparse->new('-sC'); @@ -1795,11 +1795,11 @@ } else { $body = $code } - + while (my ($key,$val) = each %munge_map) { $body =~ s/$key/$val/gs; }; - + $body }; @@ -1834,7 +1834,7 @@ use WWW::Mechanize::FormFiller; use base 'WWW::Mechanize::FormFiller::Value::Callback'; - our $VERSION = '0.57'; + our $VERSION = '0.58'; sub new { my ($class,$name,$shell) = @_; @@ -2078,7 +2078,7 @@ =head1 REPOSITORY -The public repository of this module is +The public repository of this module is L<https://github.com/Corion/WWW-Mechanize-Shell>. =head1 SUPPORT diff -Nru libwww-mechanize-shell-perl-0.57/LICENSE libwww-mechanize-shell-perl-0.58/LICENSE --- libwww-mechanize-shell-perl-0.57/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/LICENSE 2019-09-30 08:03:13.000000000 +0000 @@ -0,0 +1,201 @@ + The Artistic License 2.0 + + Copyright (c) 2000-2006, The Perl Foundation. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff -Nru libwww-mechanize-shell-perl-0.57/Makefile.PL libwww-mechanize-shell-perl-0.58/Makefile.PL --- libwww-mechanize-shell-perl-0.57/Makefile.PL 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/Makefile.PL 2019-09-30 08:03:13.000000000 +0000 @@ -1,4 +1,5 @@ # -*- mode: perl; c-basic-offset: 4; indent-tabs-mode: nil; -*- + use strict; use ExtUtils::MakeMaker qw(WriteMakefile); # See lib/ExtUtils/MakeMaker.pm for details of how to influence @@ -11,10 +12,8 @@ my $module = 'WWW::Mechanize::Shell'; (my $main_file = "lib/$module.pm" ) =~ s!::!/!g; - -# I should maybe use something like Shipwright... -regen_README($main_file); -#regen_EXAMPLES(); +(my $distbase = $module) =~ s!::!-!g; +my $distlink = $distbase; my @tests = map { glob $_ } 't/*.t', 't/*/*.t'; @@ -27,30 +26,35 @@ "meta-spec" => { version => 2 }, resources => { repository => { - web => 'https://github.com/Corion/WWW-Mechanize-Shell', - url => 'git://github.com/Corion/WWW-Mechanize-Shell.git', + web => "https://github.com/Corion/$distlink", + url => "git://github.com/Corion/$distlink.git", type => 'git', - } + }, + bugtracker => "https://rt.cpan.org/Public/Dist/Display.html?Name=$distbase", + license => "https://dev.perl.org/licenses/", }, dynamic_config => 0, # we promise to keep META.* up-to-date x_static_install => 1, # we are pure Perl and don't do anything fancy }, - - MIN_PERL_VERSION => '5.006', - LICENSE => 'perl', - + MIN_PERL_VERSION => '5.006', # I use // in some places + + 'LICENSE'=> 'perl', + PL_FILES => {}, BUILD_REQUIRES => { 'ExtUtils::MakeMaker' => 0, }, + PREREQ_PM => { 'Term::Shell' => 0.02, 'parent' => 0, 'URI::URL' => 0.00, 'Test::Harness' => 2.30, 'LWP' => 5.69, + 'LWP::UserAgent' => 0, 'WWW::Mechanize' => 1.20, + 'WWW::Mechanize::Link' => 1.20, 'WWW::Mechanize::FormFiller' => 0.05, 'Hook::LexWrap' => 0.20, 'HTTP::Cookies' => 0, @@ -60,11 +64,14 @@ TEST_REQUIRES => { 'Test::More' => 0, 'CGI' => 0, - 'Test::HTTP::LocalServer' => '0.63', # earlier has some bugs in request handling + 'File::Temp' => 0, + 'Test::HTTP::LocalServer' => '0.68', # we need basic auth handling + 'URI' => 0, + 'Test::Without::Module' => 0, # we lazy-load some optional modules }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'WWW-Mechanize-Shell-*' }, + clean => { FILES => "$distbase-*" }, test => { TESTS => join( ' ', @tests ) }, ); @@ -78,15 +85,12 @@ if( ! caller ) { # I should maybe use something like Shipwright... regen_README($main_file); - #regen_EXAMPLES(); + regen_EXAMPLES() if -d 'examples'; WriteMakefile1(get_module_info); }; 1; -# Below here is boilerplate for making this work across various old versions -# of ExtUtils::MakeMaker and for (re)generating README and README.mkdn - sub WriteMakefile1 { #Written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade. my %params=@_; my $eumm_version=$ExtUtils::MakeMaker::VERSION; @@ -110,7 +114,7 @@ delete $params{AUTHOR} if $] < 5.005; delete $params{ABSTRACT_FROM} if $] < 5.005; delete $params{BINARY_LOCATION} if $] < 5.005; - + WriteMakefile(%params); } @@ -133,7 +137,7 @@ cpan . cpanp -i . -Consult http://www.cpan.org/modules/INSTALL.html for further instruction. +Consult https://www.cpan.org/modules/INSTALL.html for further instruction. Should you wish to install this module manually, the procedure is perl Makefile.PL @@ -144,11 +148,15 @@ INSTALL pod_section($_[0], 'REPOSITORY'), pod_section($_[0], 'SUPPORT'), + pod_section($_[0], 'TALKS'), + pod_section($_[0], 'KNOWN ISSUES'), pod_section($_[0], 'BUG TRACKER'), + pod_section($_[0], 'CONTRIBUTING'), + pod_section($_[0], 'SEE ALSO'), pod_section($_[0], 'AUTHOR'), pod_section($_[0], 'LICENSE' ), pod_section($_[0], 'COPYRIGHT' ), - ; + ; update_file( 'README', $readme ); }; # README.mkdn is the documentation that will be shown as the main @@ -163,7 +171,8 @@ $parser->parse_from_file($_[0]); my $readme_mkdn = <<STATUS . $parser->as_markdown; -[![Build Status](https://travis-ci.org/Corion/WWW-Mechanize-Shell.svg?branch=master)](https://github.com/Corion/WWW-Mechanize-Shell) +[![Travis Build Status](https://travis-ci.org/Corion/$distlink.svg?branch=master)](https://travis-ci.org/Corion/$distlink) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/Corion/$distlink?branch=master&svg=true)](https://ci.appveyor.com/project/Corion/$distlink) STATUS update_file( 'README.mkdn', $readme_mkdn ); @@ -175,23 +184,38 @@ open my $fh, '<', $filename or die "Couldn't read '$filename': $!"; - my @section = + my @section = grep { /^=head1\s+$section/.../^=/ } <$fh>; - pop @section if @section and $section[-1] =~ /^=/; - shift @section if $remove_heading; # Trim the section if( @section ) { + pop @section if $section[-1] =~ /^=/; + shift @section if $remove_heading; + pop @section - while $section[-1] =~ /^\s*$/; + while @section and $section[-1] =~ /^\s*$/; shift @section - while $section[0] =~ /^\s*$/; + while @section and $section[0] =~ /^\s*$/; }; - + @section = map { $_ =~ s!^=\w+\s+!!; $_ } @section; return join "", @section; } +sub regen_EXAMPLES { + my $perl = $^X; + if ($perl =~/\s/) { + $perl = qq{"$perl"}; + }; + (my $example_file = $main_file) =~ s!\.pm$!/Examples.pm!; + my $examples = `$perl -w examples/gen_examples_pod.pl`; + if ($examples) { + warn "(Re)Creating $example_file\n"; + $examples =~ s/\r\n/\n/g; + update_file( $example_file, $examples ); + }; +}; + sub update_file { my( $filename, $new_content ) = @_; my $content; diff -Nru libwww-mechanize-shell-perl-0.57/MANIFEST libwww-mechanize-shell-perl-0.58/MANIFEST --- libwww-mechanize-shell-perl-0.57/MANIFEST 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/MANIFEST 2019-09-30 08:03:13.000000000 +0000 @@ -5,6 +5,7 @@ Changes inc/IO/Catch.pm lib/WWW/Mechanize/Shell.pm +LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP @@ -47,13 +48,15 @@ t/28-cmd-title.t t/28-html-tableextract.t t/29-launch-shell.t -t/401-server +t/embedded-WWW-Mechanize-Shell.t t/source.mech xt/99-changes.t xt/99-compile.t xt/99-manifest.t +xt/99-minimumversion.t xt/99-pod.t xt/99-synopsis.t +xt/99-test-prerequisites.t xt/99-todo.t xt/99-unix-text.t xt/99-versions.t diff -Nru libwww-mechanize-shell-perl-0.57/MANIFEST.SKIP libwww-mechanize-shell-perl-0.58/MANIFEST.SKIP --- libwww-mechanize-shell-perl-0.57/MANIFEST.SKIP 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/MANIFEST.SKIP 2019-09-30 08:03:13.000000000 +0000 @@ -2,20 +2,27 @@ \.cvsignore$ \.releaserc$ \.travis.yml$ -blib -WWW-Mechanize-Shell-* -WWW-Mechanize-Shell-*/ -CVS/ -.git/ -MANIFEST.bak -pm_to_blib -pm_to_blib.ts +\.prove cvstest +^\.git\/ +maint +^tags$ +.last_cover_stats +.appveyor.yml +^\.github Makefile$ -cover_db/ -blibdirs.ts -perlbug.rep -MYMETA +^blib +^WWW-Mechanize-Shell- +^pm_to_blib +^.*.bak +^.*.old +^t.*sessions +^t/.*\.disabled$ +^cover_db +^.*\.log +^.*\.swp$ +^jar/ +^cpan/ +^MYMETA t/hook* -^.*.old$ -^MYMETA \ No newline at end of file +CVS/ diff -Nru libwww-mechanize-shell-perl-0.57/META.json libwww-mechanize-shell-perl-0.58/META.json --- libwww-mechanize-shell-perl-0.57/META.json 2018-06-04 19:55:35.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/META.json 2019-09-30 08:03:15.000000000 +0000 @@ -4,7 +4,7 @@ "Max Maischein <corion@cpan.org>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.150005", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -19,15 +19,58 @@ "inc" ] }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "HTML::Display" : "0", + "HTML::TokeParser::Simple" : "2", + "HTTP::Cookies" : "0", + "Hook::LexWrap" : "0.2", + "LWP" : "5.69", + "LWP::UserAgent" : "0", + "Term::Shell" : "0.02", + "Test::Harness" : "2.3", + "URI::URL" : "0", + "WWW::Mechanize" : "1.2", + "WWW::Mechanize::FormFiller" : "0.05", + "WWW::Mechanize::Link" : "1.2", + "parent" : "0", + "perl" : "5.006" + } + }, + "test" : { + "requires" : { + "CGI" : "0", + "File::Temp" : "0", + "Test::HTTP::LocalServer" : "0.68", + "Test::More" : "0", + "Test::Without::Module" : "0", + "URI" : "0" + } + } + }, "release_status" : "stable", "resources" : { + "license" : [ + "https://dev.perl.org/licenses/" + ], "repository" : { "type" : "git", "url" : "git://github.com/Corion/WWW-Mechanize-Shell.git", "web" : "https://github.com/Corion/WWW-Mechanize-Shell" } }, - "version" : "0.57", - "x_serialization_backend" : "JSON::PP version 2.27202", + "version" : "0.58", + "x_serialization_backend" : "JSON::PP version 2.27203", "x_static_install" : 1 } diff -Nru libwww-mechanize-shell-perl-0.57/META.yml libwww-mechanize-shell-perl-0.58/META.yml --- libwww-mechanize-shell-perl-0.57/META.yml 2018-06-04 19:55:34.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/META.yml 2019-09-30 08:03:15.000000000 +0000 @@ -2,9 +2,18 @@ abstract: 'An interactive shell for WWW::Mechanize' author: - 'Max Maischein <corion@cpan.org>' -build_requires: {} +build_requires: + CGI: '0' + ExtUtils::MakeMaker: '0' + File::Temp: '0' + Test::HTTP::LocalServer: '0.68' + Test::More: '0' + Test::Without::Module: '0' + URI: '0' +configure_requires: + ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.150005' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -14,8 +23,24 @@ directory: - t - inc +requires: + HTML::Display: '0' + HTML::TokeParser::Simple: '2' + HTTP::Cookies: '0' + Hook::LexWrap: '0.2' + LWP: '5.69' + LWP::UserAgent: '0' + Term::Shell: '0.02' + Test::Harness: '2.3' + URI::URL: '0' + WWW::Mechanize: '1.2' + WWW::Mechanize::FormFiller: '0.05' + WWW::Mechanize::Link: '1.2' + parent: '0' + perl: '5.006' resources: + license: https://dev.perl.org/licenses/ repository: git://github.com/Corion/WWW-Mechanize-Shell.git -version: '0.57' +version: '0.58' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 diff -Nru libwww-mechanize-shell-perl-0.57/README libwww-mechanize-shell-perl-0.58/README --- libwww-mechanize-shell-perl-0.57/README 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/README 2019-09-30 08:03:13.000000000 +0000 @@ -21,7 +21,7 @@ cpan . cpanp -i . -Consult http://www.cpan.org/modules/INSTALL.html for further instruction. +Consult https://www.cpan.org/modules/INSTALL.html for further instruction. Should you wish to install this module manually, the procedure is perl Makefile.PL @@ -32,7 +32,7 @@ REPOSITORY -The public repository of this module is +The public repository of this module is L<https://github.com/Corion/WWW-Mechanize-Shell>. SUPPORT @@ -41,6 +41,13 @@ L<http://perlmonks.org/>. + + + +SEE ALSO + +L<WWW::Mechanize>,L<WWW::Mechanize::FormFiller>,L<WWW::Mechanize::Firefox> + AUTHOR Max Maischein, E<lt>corion@cpan.orgE<gt> diff -Nru libwww-mechanize-shell-perl-0.57/README.mkdn libwww-mechanize-shell-perl-0.58/README.mkdn --- libwww-mechanize-shell-perl-0.57/README.mkdn 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/README.mkdn 2019-09-30 08:03:13.000000000 +0000 @@ -1,5 +1,6 @@ -[![Build Status](https://travis-ci.org/Corion/WWW-Mechanize-Shell.svg?branch=master)](https://github.com/Corion/WWW-Mechanize-Shell) +[![Travis Build Status](https://travis-ci.org/Corion/WWW-Mechanize-Shell.svg?branch=master)](https://travis-ci.org/Corion/WWW-Mechanize-Shell) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/Corion/WWW-Mechanize-Shell?branch=master&svg=true)](https://ci.appveyor.com/project/Corion/WWW-Mechanize-Shell) # NAME @@ -179,7 +180,7 @@ Prints all `<H1>` through `<H5>` strings found in the content, indented accordingly. With an argument, prints only those -levels; e.g., `headers 145` prints H1,H4,H5 strings only. +levels; e.g., `headers 145` prints H1,H4,H5 strings only. ## ua @@ -728,7 +729,7 @@ # REPOSITORY -The public repository of this module is +The public repository of this module is [https://github.com/Corion/WWW-Mechanize-Shell](https://github.com/Corion/WWW-Mechanize-Shell). # SUPPORT diff -Nru libwww-mechanize-shell-perl-0.57/t/00a-Term-Shell-catch-smry.t libwww-mechanize-shell-perl-0.58/t/00a-Term-Shell-catch-smry.t --- libwww-mechanize-shell-perl-0.57/t/00a-Term-Shell-catch-smry.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/00a-Term-Shell-catch-smry.t 2019-09-30 08:03:13.000000000 +0000 @@ -14,7 +14,7 @@ # Now check that the Term::Shell summary calls catch_smry require Term::Shell; - use vars qw( $called ); + our $called; { package Term::Shell::Test; use base 'Term::Shell'; diff -Nru libwww-mechanize-shell-perl-0.57/t/00-load.t libwww-mechanize-shell-perl-0.58/t/00-load.t --- libwww-mechanize-shell-perl-0.57/t/00-load.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/00-load.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,16 +1,15 @@ #!perl -T - use strict; use warnings; use Test::More tests => 1; -my $module; +require './Makefile.PL'; +my %module = get_module_info(); + +my $module = $module{ NAME }; -BEGIN { - $module = "WWW::Mechanize::Shell"; - require_ok( $module ); -} +require_ok( $module ); diag( sprintf "Testing %s %s, Perl %s", $module, $module->VERSION, $] ); diff -Nru libwww-mechanize-shell-perl-0.57/t/03-documentation.t libwww-mechanize-shell-perl-0.58/t/03-documentation.t --- libwww-mechanize-shell-perl-0.57/t/03-documentation.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/03-documentation.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,7 +1,7 @@ use strict; use FindBin; -use vars qw( @methods ); +our @methods; BEGIN { my $module = "$FindBin::Bin/../lib/WWW/Mechanize/Shell.pm"; open MODULE, "< $module" diff -Nru libwww-mechanize-shell-perl-0.57/t/04-history-invariant.t libwww-mechanize-shell-perl-0.58/t/04-history-invariant.t --- libwww-mechanize-shell-perl-0.57/t/04-history-invariant.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/04-history-invariant.t 2019-09-30 08:03:13.000000000 +0000 @@ -7,7 +7,7 @@ # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; -use vars qw( @history_invariant @history_add ); +our( @history_invariant, @history_add ); BEGIN { # Disable all ReadLine functionality @@ -90,7 +90,7 @@ shift; push @history, join "", @_; }; - + *WWW::Mechanize::links = sub {()}; }; diff -Nru libwww-mechanize-shell-perl-0.57/t/05-options.t libwww-mechanize-shell-perl-0.58/t/05-options.t --- libwww-mechanize-shell-perl-0.57/t/05-options.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/05-options.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,10 +1,7 @@ #!/usr/bin/perl -w use strict; -use vars qw( @options ); - -BEGIN { - @options = qw( +our @options = (qw( autosync autorestart watchfiles @@ -13,16 +10,15 @@ dumpresponses verbose warnings - ); -}; +)); -use Test::More tests => scalar @options*4 +1+4; +use Test::More; +plan tests => scalar @options*4 +4; -SKIP: { BEGIN { $ENV{PERL_RL} = 0; - use_ok('WWW::Mechanize::Shell'); }; + require WWW::Mechanize::Shell; my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); @@ -44,4 +40,3 @@ $res = $s->option('doesnotexist','newvalue'); is( $res, undef, "Nonexisting option returns undef" ); is( $warned, "Unknown option 'doesnotexist'","Nonexisting option raises a warning" ); -}; diff -Nru libwww-mechanize-shell-perl-0.57/t/06-valid-output.t libwww-mechanize-shell-perl-0.58/t/06-valid-output.t --- libwww-mechanize-shell-perl-0.57/t/06-valid-output.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/06-valid-output.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,12 +1,11 @@ #!/usr/bin/perl -w use strict; -use lib './inc'; -use IO::Catch; -use Test::More (); - +use Test::More; use File::Temp qw( tempfile ); use WWW::Mechanize::Link; +use lib './inc'; +use IO::Catch; # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; @@ -18,10 +17,7 @@ $ENV{PERL_RL} = 0; }; -use vars qw( %tests ); - -BEGIN { - %tests = ( +our %tests = ( 'autofill' => 'autofill test Fixed value', 'back' => 'back', 'click' => 'click', @@ -45,19 +41,20 @@ 'ua' => 'ua foo/1.1', 'untick' => 'untick key value', 'untick_all' => 'untick key', - ); +); - eval { +eval { require HTML::TableExtract; $HTML::TableExtract::VERSION >= 2 or die "Need HTML::TableExtract version >= 2"; $tests{table} = 'table'; $tests{'table params'} = 'table foo bar'; - }; }; -use Test::More tests => scalar (keys %tests)*2 +1; -BEGIN { use_ok('WWW::Mechanize::Shell'); }; +plan tests => scalar (keys %tests)*2; + +use WWW::Mechanize::Shell; + SKIP: { eval { diff -Nru libwww-mechanize-shell-perl-0.57/t/07-history-items.t libwww-mechanize-shell-perl-0.58/t/07-history-items.t --- libwww-mechanize-shell-perl-0.57/t/07-history-items.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/07-history-items.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,21 +1,21 @@ #!/usr/bin/perl -w use strict; -use lib './inc'; -use IO::Catch; +use Test::More; use File::Temp qw( tempfile ); use WWW::Mechanize::Link; +use lib './inc'; +use IO::Catch; # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; -use vars qw( %tests ); - BEGIN { # Disable all ReadLine functionality $ENV{PERL_RL} = 0; +}; - %tests = ( +our %tests = ( 'autofill' => 'autofill test Fixed value', 'back' => 'back', 'click' => 'click', @@ -47,9 +47,8 @@ $tests{table params} = 'table foo bar'; ; }; -}; -use Test::More tests => scalar (keys %tests) +1; +plan tests => scalar (keys %tests) +1; SKIP: { eval { diff -Nru libwww-mechanize-shell-perl-0.57/t/12-comments.t libwww-mechanize-shell-perl-0.58/t/12-comments.t --- libwww-mechanize-shell-perl-0.57/t/12-comments.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/12-comments.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,18 +3,19 @@ use lib './inc'; use IO::Catch; -use vars qw( @comments $_STDOUT_ $_STDERR_ ); +our ($_STDOUT_, $_STDERR_ ); # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; -BEGIN { @comments = ( "#", "# a test", "#eval 1", "# eval 1", "## eval 1" )}; +our @comments = ( "#", "# a test", "#eval 1", "# eval 1", "## eval 1" ); # Disable all ReadLine functionality $ENV{PERL_RL} = 0; -use Test::More tests => 1 + scalar @comments * 3; +use Test::More; +plan tests => 1 + scalar @comments * 3; SKIP: { #skip "Can't load Term::ReadKey without a terminal", 1 + scalar @comments * 3 # unless -t STDIN; diff -Nru libwww-mechanize-shell-perl-0.57/t/13-command-au.t libwww-mechanize-shell-perl-0.58/t/13-command-au.t --- libwww-mechanize-shell-perl-0.57/t/13-command-au.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/13-command-au.t 2019-09-30 08:03:13.000000000 +0000 @@ -4,7 +4,9 @@ use lib './inc'; use IO::Catch; -use vars qw( $_STDOUT_ $_STDERR_ ); +our ( $_STDOUT_, $_STDERR_ ); +use URI; +use Test::HTTP::LocalServer; # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; @@ -12,105 +14,47 @@ # Disable all ReadLine functionality $ENV{PERL_RL} = 0; -use Test::More tests => 6; -SKIP: { +use Test::More tests => 4; -use_ok('WWW::Mechanize::Shell'); +use WWW::Mechanize::Shell; -eval { require HTTP::Daemon; }; -skip "HTTP::Daemon required to test basic authentication",7 - if ($@); - -# We want to be safe from non-resolving local host names -delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)}; +my $server = Test::HTTP::LocalServer->spawn(); my $user = 'foo'; my $pass = 'bar'; -# Now start a fake webserver, fork, and connect to ourselves -open SERVER, qq{"$^X" "$FindBin::Bin/401-server" $user $pass |} - or die "Couldn't spawn fake server : $!"; -sleep 1; # give the child some time -my $url = <SERVER>; -chomp $url; -die "Couldn't decipher host/port from '$url'" - unless $url =~ m!^http://([^/]+)/!; -my $host = $1; +my $url = URI->new( $server->basic_auth($user => $pass)); +my $host = $url->host; my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); -# First try with an inline username/password -my $pwd_url = $url; -$pwd_url =~ s!^http://!http://$user:$pass\@!; -$pwd_url .= 'thisshouldpass'; -diag "get $pwd_url"; -$s->cmd( "get $pwd_url" ); -diag $s->agent->res->message - unless is($s->agent->res->code, 200, "Request with inline credentials gives 200"); -is($s->agent->content, "user = 'foo' pass = 'bar'", "Credentials are good"); - -# Now try without credentials -my $bare_url = $url . "thisshouldfail"; +# Try without credentials: +my $bare_url = $url; diag "get $bare_url"; $s->cmd( "get $bare_url" ); my $code = $s->agent->response->code; my $got_url = $s->agent->uri; -if (! ok $code == 401 || $got_url ne $bare_url, "Request without credentials gives 401 (or is hidden by a WWW::Mechanize bug)") { +if (! is $code, 401, "Request without credentials gives 401") { diag "Page location : " . $s->agent->uri; - diag $s->agent->res->as_string; -}; - -SKIP: { -if ($got_url ne $url) { - skip "WWW::Mechanize 1.50 has a bug that doesn't give you a 401 page", 1; -} else { - like($s->agent->content, '/^auth required /', "Content requests authentication") - or diag $s->agent->res->as_string; -}; }; -# Now try the shell command for authentication -$s->cmd( "auth foo bar" ); - -# WWW::Mechanize breaks the LWP::UserAgent API in a bad, bad way -# it even monkeypatches LWP::UserAgent so we have no better way -# than to hope for the best :-((( - -# If it didn't return our expected credentials, we're a victim of -# WWW::Mechanize's monkeypatch :-( -my @credentials = $s->agent->get_basic_credentials(); - -if ($credentials[0] ne 'foo') { - SKIP: { - skip "WWW::Mechanize $WWW::Mechanize::VERSION has buggy implementation/override of ->credentials", 1; - }; -} else { - diag "Credentials are @credentials"; - use Data::Dumper; - my $a = $s->agent; - @credentials = $a->get_basic_credentials(); - diag "Credentials are @credentials"; - - my @real_credentials = LWP::UserAgent::credentials($a,$host,'testing realm'); - SKIP: { - if ($real_credentials[0] ne $credentials[0]) { - skip "WWW::Mechanize credentials() patch breaks LWP::UserAgent credentials()", 1; - } else { - $s->cmd( "get $url" ); - diag $s->agent->res->message - unless is($s->agent->res->code, 200, "Request with credentials gives 200"); - is($s->agent->content, "user = 'foo' pass = 'bar'", "Credentials are good"); - }; - }; +# Now try the shell command for authentication with bad credentials +$s->cmd( "auth x$user x$pass" ); +$bare_url = $url; +diag "get $bare_url"; +eval { + $s->cmd( "get $bare_url" ); }; +is $s->agent->res->code, 401, "Wrong password still results in a 401"; +like $@, qr/Auth Required/, "We die because of that"; -diag "Shutting down test server at $url"; -$s->agent->get("${url}exit"); # shut down server +# Now try the shell command for authentication with correct credentials +$s->cmd( "auth $user $pass" ); +$s->cmd( "get $bare_url" ); +is $s->agent->res->code, 200, "Right password results in 200"; -}; +#diag "Shutting down test server at $url"; +$server->stop; -END { - close SERVER; # boom -}; diff -Nru libwww-mechanize-shell-perl-0.57/t/14-command-identity.t libwww-mechanize-shell-perl-0.58/t/14-command-identity.t --- libwww-mechanize-shell-perl-0.57/t/14-command-identity.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/14-command-identity.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,13 +1,15 @@ #!/usr/bin/perl -w use strict; -use lib './inc'; use FindBin; -use IO::Catch; use File::Temp qw( tempfile ); -use vars qw( %tests $_STDOUT_ $_STDERR_ ); +our ($_STDOUT_, $_STDERR_ ); use URI::URL; -use LWP::Simple; +#use LWP::Simple; +use Test::HTTP::LocalServer; +use Test::More; +use lib './inc'; +use IO::Catch; # Catch output: $SIG{__WARN__} = sub { $main::_STDERR_ .= join '', @_; }; @@ -21,8 +23,7 @@ }; use HTML::Display; -BEGIN { - %tests = ( +our %tests = ( autofill => { requests => 2, lines => [ 'get %s', 'autofill query Fixed foo', 'autofill cat Keep', @@ -189,6 +190,7 @@ location => qr'^%s/formsubmit$' }, ); +BEGIN { eval { require HTML::TableExtract; $tests{get_table} = { requests => 1, lines => [ 'get %s','table' ], location => qr'^%s/$' }; @@ -204,29 +206,23 @@ }; }; -use Test::More tests => 1 + (scalar keys %tests)*10; +plan tests => (scalar keys %tests)*10; BEGIN { # Disable all ReadLine functionality $ENV{PERL_RL} = 0; - require LWP::UserAgent; + #require LWP::UserAgent; #my $old = \&LWP::UserAgent::request; #print STDERR $old; #*LWP::UserAgent::request = sub {print STDERR "LWP::UserAgent::request\n"; goto &$old }; - use_ok('WWW::Mechanize::Shell'); }; +use WWW::Mechanize::Shell; SKIP: { -diag "Loading HTTP::Daemon"; -eval { require HTTP::Daemon; }; -skip "HTTP::Daemon required to test script/code identity",(scalar keys %tests)*8 - if ($@); -# require Test::HTTP::LocalServer; # from inc -use Test::HTTP::LocalServer; # from inc # We want to be safe from non-resolving local host names delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)}; -use vars qw( $actual_requests $dumped_requests ); +our ($actual_requests, $dumped_requests ); { no warnings qw'redefine once'; my $old_request = *WWW::Mechanize::_make_request{CODE}; @@ -244,9 +240,8 @@ #}; }; -diag "Spawning local test server"; my $server = Test::HTTP::LocalServer->spawn(); -diag sprintf "on port %s", $server->port; +diag "Spawned local test server at " . $server->url; for my $name (sort keys %tests) { $_STDOUT_ = ''; @@ -260,7 +255,7 @@ my $url = $server->url; $url =~ s!/$!!; - my $result_location = sprintf $tests{$name}->{location}, $url; + my $result_location = sprintf $tests{$name}->{location}, quotemeta $url; $result_location = qr{$result_location}; my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); $s->option("dumprequests",1); diff -Nru libwww-mechanize-shell-perl-0.57/t/15-history-save.t libwww-mechanize-shell-perl-0.58/t/15-history-save.t --- libwww-mechanize-shell-perl-0.57/t/15-history-save.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/15-history-save.t 2019-09-30 08:03:13.000000000 +0000 @@ -7,11 +7,11 @@ # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; -use Test::More tests => 7; +use Test::More tests => 6; # Disable all ReadLine functionality -$ENV{PERL_RL} = 0; +BEGIN { $ENV{PERL_RL} = 0; }; -use_ok('WWW::Mechanize::Shell'); +use WWW::Mechanize::Shell; my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); diff -Nru libwww-mechanize-shell-perl-0.57/t/16-form-fillout.t libwww-mechanize-shell-perl-0.58/t/16-form-fillout.t --- libwww-mechanize-shell-perl-0.57/t/16-form-fillout.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/16-form-fillout.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,21 +1,21 @@ #!/usr/bin/perl -w use strict; use FindBin; -use lib './inc'; -use IO::Catch; +use Test::More; use File::Temp qw( tempfile ); -use vars qw( %tests $_STDOUT_ $_STDERR_ ); +our ($_STDOUT_, $_STDERR_ ); use URI::URL; -use LWP::Simple; +use Test::HTTP::LocalServer; +use lib './inc'; +use IO::Catch; # pre-5.8.0's warns aren't caught by a tied STDERR. $SIG{__WARN__} = sub { $main::_STDERR_ .= join '', @_; }; tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; -BEGIN { - %tests = ( +our %tests = ( interactive_script_creation => { requests => 2, lines => [ 'eval @::list=qw(1 2 3 4 5 6 7 8 9 10 foo NY 11 DE 13 V 15 16 2038-01-01)', 'eval @@ -32,24 +32,18 @@ 'content' ], location => '%sgift_card/alphasite/www/cgi-bin/giftcard.cgi/checkout_process' }, ); -}; -use Test::More tests => 1 + (scalar keys %tests)*6; +plan tests => (scalar keys %tests)*6; BEGIN { delete $ENV{PAGER}; $ENV{PERL_RL} = 0; - use_ok('WWW::Mechanize::Shell'); }; +use WWW::Mechanize::Shell; SKIP: { # Disable all ReadLine functionality my $HTML = do { local $/; <DATA> }; -eval { require HTTP::Daemon; }; -skip "HTTP::Daemon required to test script/code identity",(scalar keys %tests)*6 - if ($@); -require Test::HTTP::LocalServer; # from inc - # We want to be safe from non-resolving local host names delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)}; diff -Nru libwww-mechanize-shell-perl-0.57/t/17-eval-multiline.t libwww-mechanize-shell-perl-0.58/t/17-eval-multiline.t --- libwww-mechanize-shell-perl-0.57/t/17-eval-multiline.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/17-eval-multiline.t 2019-09-30 08:03:13.000000000 +0000 @@ -4,7 +4,7 @@ use IO::Catch; use File::Temp qw( tempfile ); -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; diff -Nru libwww-mechanize-shell-perl-0.57/t/18-browser-autosync.t libwww-mechanize-shell-perl-0.58/t/18-browser-autosync.t --- libwww-mechanize-shell-perl-0.57/t/18-browser-autosync.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/18-browser-autosync.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,15 +1,14 @@ #!/usr/bin/perl -w use strict; +use Test::HTTP::LocalServer; +use Test::More; use lib './inc'; use IO::Catch; # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; -use vars qw( %tests ); - -BEGIN { - %tests = ( +our %tests = ( back => { count => 3, commands => ['get %s','click submit','back']}, browse => { count => 2, commands => [ 'get %s', 'browse' ] }, get => { count => 1, commands => ['get %s']} , @@ -17,24 +16,14 @@ submit => { count => 2, commands => ['get %s','submit']}, click => { count => 2, commands => ['get %s','click submit']}, reload => { count => 2, commands => ['get %s','reload'] }, - ) -}; - -use Test::More tests => scalar (keys %tests) +1; -SKIP: { + ); +plan tests => scalar (keys %tests); BEGIN { # Disable all ReadLine functionality $ENV{PERL_RL} = 0; - use_ok('WWW::Mechanize::Shell'); - - eval { require HTTP::Daemon; }; - skip "HTTP::Daemon required to test browser synchronisation",(scalar keys %tests)*6 - if ($@); - use lib './inc'; - require Test::HTTP::LocalServer; # from inc - delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)}; }; +use WWW::Mechanize::Shell; my $browser_synced; { no warnings 'redefine'; @@ -43,13 +32,14 @@ }; }; +my $server = Test::HTTP::LocalServer->spawn(); + sub sync_ok { my %args = @_; my $name = $args{name}; my $count = $args{count}; my (@commands) = @{$args{commands}}; - my $server = Test::HTTP::LocalServer->spawn(); my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); $s->option('autosync', 1); $browser_synced = 0; @@ -61,11 +51,10 @@ }; is($browser_synced,$count,"'$name' synchronizes $count times") or diag join "\n", @commands; - $server->stop; }; for my $cmd (sort keys %tests) { sync_ok( name => $cmd, %{$tests{$cmd}} ); }; -}; +$server->stop; diff -Nru libwww-mechanize-shell-perl-0.57/t/21-autofill-re.t libwww-mechanize-shell-perl-0.58/t/21-autofill-re.t --- libwww-mechanize-shell-perl-0.57/t/21-autofill-re.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/21-autofill-re.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,7 +3,7 @@ use lib './inc'; use File::Temp qw( tempfile ); use IO::Catch; -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); # pre-5.8.0's warns aren't caught by a tied STDERR. tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; diff -Nru libwww-mechanize-shell-perl-0.57/t/23-check-dumpresponses.t libwww-mechanize-shell-perl-0.58/t/23-check-dumpresponses.t --- libwww-mechanize-shell-perl-0.57/t/23-check-dumpresponses.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/23-check-dumpresponses.t 2019-09-30 08:03:13.000000000 +0000 @@ -4,7 +4,7 @@ use IO::Catch; use Test::HTTP::LocalServer; -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; diff -Nru libwww-mechanize-shell-perl-0.57/t/24-source-file.t libwww-mechanize-shell-perl-0.58/t/24-source-file.t --- libwww-mechanize-shell-perl-0.57/t/24-source-file.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/24-source-file.t 2019-09-30 08:03:13.000000000 +0000 @@ -4,11 +4,11 @@ use IO::Catch; use Test::HTTP::LocalServer; -use vars qw($_STDOUT_ $_STDERR_); +our ( $_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; -use Test::More tests => 6; +use Test::More tests => 5; # Disable all ReadLine functionality $ENV{PERL_RL} = 0; @@ -18,7 +18,7 @@ delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)}; -use_ok('WWW::Mechanize::Shell'); +require WWW::Mechanize::Shell; my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); # Now test diff -Nru libwww-mechanize-shell-perl-0.57/t/25-save-file-nolink.t libwww-mechanize-shell-perl-0.58/t/25-save-file-nolink.t --- libwww-mechanize-shell-perl-0.57/t/25-save-file-nolink.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/25-save-file-nolink.t 2019-09-30 08:03:13.000000000 +0000 @@ -4,7 +4,7 @@ use IO::Catch; use Test::HTTP::LocalServer; -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; @@ -31,10 +31,10 @@ $s->cmd("save"); is($_STDOUT_,"No link given to save\n","save error message"); is($_STDERR_,undef,"No warnings"); - + $_STDOUT_ = undef; $_STDERR_ = undef; - + $s->cmd("save /does-not-exist/"); like($_STDOUT_,'/No match for \/\(\?(-xism|\^):does-not-exist\)\/.\n/',"save RE error message"); is($_STDERR_,undef,"No warnings"); diff -Nru libwww-mechanize-shell-perl-0.57/t/26-form-no-form.t libwww-mechanize-shell-perl-0.58/t/26-form-no-form.t --- libwww-mechanize-shell-perl-0.57/t/26-form-no-form.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/26-form-no-form.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,7 +3,7 @@ use lib './inc'; use IO::Catch; -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; diff -Nru libwww-mechanize-shell-perl-0.57/t/27-form_number.t libwww-mechanize-shell-perl-0.58/t/27-form_number.t --- libwww-mechanize-shell-perl-0.57/t/27-form_number.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/27-form_number.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,7 +3,7 @@ use lib './inc'; use IO::Catch; -use vars qw($_STDOUT_ $_STDERR_); +our ($_STDOUT_, $_STDERR_); tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; tie *STDERR, 'IO::Catch', '_STDERR_' or die $!; diff -Nru libwww-mechanize-shell-perl-0.57/t/27-index.html libwww-mechanize-shell-perl-0.58/t/27-index.html --- libwww-mechanize-shell-perl-0.57/t/27-index.html 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/27-index.html 2019-09-30 08:03:13.000000000 +0000 @@ -1,7 +1,7 @@ -<html> +<html> <head> </head> -<body> +<body> <H2> Mui. </h2> diff -Nru libwww-mechanize-shell-perl-0.57/t/28-cmd-headers.t libwww-mechanize-shell-perl-0.58/t/28-cmd-headers.t --- libwww-mechanize-shell-perl-0.57/t/28-cmd-headers.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/28-cmd-headers.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,7 +3,7 @@ use lib './inc'; use IO::Catch; -use vars qw($_STDOUT_); +our $_STDOUT_; tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; # Disable all ReadLine functionality diff -Nru libwww-mechanize-shell-perl-0.57/t/28-cmd-title.t libwww-mechanize-shell-perl-0.58/t/28-cmd-title.t --- libwww-mechanize-shell-perl-0.57/t/28-cmd-title.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/28-cmd-title.t 2019-09-30 08:03:13.000000000 +0000 @@ -3,7 +3,7 @@ use lib './inc'; use IO::Catch; -use vars qw($_STDOUT_ ); +our $_STDOUT_; tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!; # Disable all ReadLine functionality diff -Nru libwww-mechanize-shell-perl-0.57/t/28-html-tableextract.t libwww-mechanize-shell-perl-0.58/t/28-html-tableextract.t --- libwww-mechanize-shell-perl-0.57/t/28-html-tableextract.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/28-html-tableextract.t 2019-09-30 08:03:13.000000000 +0000 @@ -14,7 +14,7 @@ my $have_tableextract = eval { require HTML::TableExtract; - die "Need at least HTML::TableExtract v2, found '$HTML::TableExtract::VERSION'" + die "Need at least HTML::TableExtract v2, found '$HTML::TableExtract::VERSION'" unless $HTML::TableExtract::VERSION > 2; 1 }; @@ -30,7 +30,7 @@ my @output; local *WWW::Mechanize::Shell::print_paged = sub { shift @_; - push @output, grep { /\S/ } @_; + push @output, grep { /\S/ } @_; }; $s->agent->{base} = 'http://example.com'; $s->agent->update_html(<<HTML); diff -Nru libwww-mechanize-shell-perl-0.57/t/401-server libwww-mechanize-shell-perl-0.58/t/401-server --- libwww-mechanize-shell-perl-0.57/t/401-server 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/401-server 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -# Thanks to merlyn for nudging me and giving me this snippet! -use strict; -use HTTP::Daemon; -use LWP::UserAgent; - -$|++; - -my $host = 'localhost'; -my $d = HTTP::Daemon->new( - LocalAddr => $host, -) or die; - -# HTTP::Deamon doesn't return http://localhost:.../ -# for LocalAddr => 'localhost'. This causes the -# tests to fail of many machines. -( my $url = URI->new($d->url) )->host($host); -print "$url\n"; - -# How many requests do we expect? -my ($ex_user,$ex_pass) = @ARGV; - -my $verbose = $ENV{TEST_HTTP_VERBOSE}; - -my $done = 0; -while (! $done and my $c = $d->accept) { - while (my $req = $c->get_request) { - if ($verbose) { - warn "# Request URI: " . $req->url->path; - my @lines = split "\n",$req->as_string; - warn "# $_\n" for @lines; - }; - - my $res; - my ($user,$pass); - if ($req->url->path eq '/exit') { - $done = 1; - $res = HTTP::Response->new(200, "OK", undef, "done"); - - } elsif ( ($user, $pass) = $req->authorization_basic - and $user eq $ex_user - and $pass eq $ex_pass) { - $res = HTTP::Response->new(200, "OK", undef, - "user = '$user' pass = '$pass'"); - - } else { - warn "# User : '$user' Password : '$pass'\n" - if $verbose; - $res = HTTP::Response->new(401, "Auth Required", undef, - "auth required ($user/$pass)"); - $res->www_authenticate("Basic realm=\"testing realm\""); - }; - - if ($verbose) { - warn "---\n"; - my @lines = split "\n",$res->as_string; - warn "# $_\n" for @lines; - }; - $c->send_response($res); - } - $c->close; - undef($c); -}; diff -Nru libwww-mechanize-shell-perl-0.57/t/embedded-WWW-Mechanize-Shell.t libwww-mechanize-shell-perl-0.58/t/embedded-WWW-Mechanize-Shell.t --- libwww-mechanize-shell-perl-0.57/t/embedded-WWW-Mechanize-Shell.t 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/t/embedded-WWW-Mechanize-Shell.t 2019-09-30 08:03:13.000000000 +0000 @@ -0,0 +1,139 @@ +#!/opt/perl58/bin/perl -w + +use Test::More 'no_plan'; + +package Catch; + +sub TIEHANDLE { + my($class, $var) = @_; + return bless { var => $var }, $class; +} + +sub PRINT { + my($self) = shift; + ${'main::'.$self->{var}} .= join '', @_; +} + +sub OPEN {} # XXX Hackery in case the user redirects +sub CLOSE {} # XXX STDERR/STDOUT. This is not the behavior we want. + +sub READ {} +sub READLINE {} +sub GETC {} +sub BINMODE {} + +my $Original_File = 'lib/WWW/Mechanize/Shell.pm'; + +package main; + +# pre-5.8.0's warns aren't caught by a tied STDERR. +$SIG{__WARN__} = sub { $main::_STDERR_ .= join '', @_; }; +tie *STDOUT, 'Catch', '_STDOUT_' or die $!; +tie *STDERR, 'Catch', '_STDERR_' or die $!; + +SKIP: { + # A header testing whether we find all prerequisites : + # Check for module WWW::Mechanize::Shell + eval { require WWW::Mechanize::Shell }; + skip "Need module WWW::Mechanize::Shell to run this test", 1 + if $@; + + # Check for module strict + eval { require strict }; + skip "Need module strict to run this test", 1 + if $@; + + + # The original POD test + undef $main::_STDOUT_; + undef $main::_STDERR_; +eval q{ + my $example = sub { + local $^W = 0; + +#line 33 lib/WWW/Mechanize/Shell.pm + + #!/usr/bin/perl -w + use strict; + use WWW::Mechanize::Shell; + + my $shell = WWW::Mechanize::Shell->new("shell"); + + if (@ARGV) { + $shell->source_file( @ARGV ); + } else { + $shell->cmdloop; + }; + + + + +; + + } +}; +is($@, '', "example from line 33"); + +}; +SKIP: { + # A header testing whether we find all prerequisites : + # Check for module WWW::Mechanize::Shell + eval { require WWW::Mechanize::Shell }; + skip "Need module WWW::Mechanize::Shell to run this test", 1 + if $@; + + # Check for module strict + eval { require strict }; + skip "Need module strict to run this test", 1 + if $@; + + + # The original POD test + { + undef $main::_STDOUT_; + undef $main::_STDERR_; +#line 33 lib/WWW/Mechanize/Shell.pm + + #!/usr/bin/perl -w + use strict; + use WWW::Mechanize::Shell; + + my $shell = WWW::Mechanize::Shell->new("shell"); + + if (@ARGV) { + $shell->source_file( @ARGV ); + } else { + $shell->cmdloop; + }; + + + + + BEGIN { + require WWW::Mechanize::Shell; + $ENV{PERL_RL} = 0; + $ENV{COLUMNS} = '80'; + $ENV{LINES} = '24'; + }; + BEGIN { + no warnings 'once'; + no warnings 'redefine'; + *WWW::Mechanize::Shell::cmdloop = sub {}; + *WWW::Mechanize::Shell::display_user_warning = sub {}; + *WWW::Mechanize::Shell::source_file = sub {}; + }; + isa_ok( $shell, "WWW::Mechanize::Shell" ); + + undef $main::_STDOUT_; + undef $main::_STDERR_; +} + +}; +SKIP: { + # A header testing whether we find all prerequisites : + + # The original POD test + undef $main::_STDOUT_; + undef $main::_STDERR_; + +}; diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-changes.t libwww-mechanize-shell-perl-0.58/xt/99-changes.t --- libwww-mechanize-shell-perl-0.57/xt/99-changes.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-changes.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,31 +1,30 @@ -#!perl -w -use warnings; -use strict; -use File::Find; -use Test::More tests => 2; - -=head1 PURPOSE - -This test ensures that the Changes file -mentions the current version and that a -release date is mentioned as well - -=cut - -use vars '%module'; -require './Makefile.PL'; -# Loaded from Makefile.PL -%module = get_module_info(); -my $module = $module{NAME}; - -(my $file = $module) =~ s!::!/!g; -require "$file.pm"; - -my $version = sprintf '%0.2f', $module->VERSION; - -my $changes = do { local $/; open my $fh, 'Changes' or die $!; <$fh> }; - -ok $changes =~ /^(.*$version.*)$/m, "We find version $version for $module"; -my $changes_line = $1; -ok $changes_line =~ /$version\s+20\d{6}/, "We find a release date on the same line" - or diag $changes_line; +#!perl -w +use warnings; +use strict; +use File::Find; +use Test::More tests => 2; + +=head1 PURPOSE + +This test ensures that the Changes file +mentions the current version and that a +release date is mentioned as well + +=cut + +require './Makefile.PL'; +# Loaded from Makefile.PL +our %module = get_module_info(); +my $module = $module{NAME}; + +(my $file = $module) =~ s!::!/!g; +require "$file.pm"; + +my $version = sprintf '%0.2f', $module->VERSION; + +my $changes = do { local $/; open my $fh, 'Changes' or die $!; <$fh> }; + +ok $changes =~ /^(.*$version.*)$/m, "We find version $version for $module"; +my $changes_line = $1; +ok $changes_line =~ /$version\s+20\d\d-[01]\d-[0123]\d\b/, "We find a release date on the same line" + or diag $changes_line; diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-compile.t libwww-mechanize-shell-perl-0.58/xt/99-compile.t --- libwww-mechanize-shell-perl-0.57/xt/99-compile.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-compile.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,5 +1,4 @@ -#!perl -w - +#!perl use warnings; use strict; use File::Find; @@ -20,14 +19,15 @@ return if (! m{(\.pm|\.pl) \z}xmsi); my ($stdout, $stderr, $exit) = capture(sub { - system( $^X, '-Mblib', '-wc', $_ ); + system( $^X, '-Mblib', '-c', $_ ); }); s!\s*\z!! for ($stdout, $stderr); if( $exit ) { - diag $exit; + diag $stderr; + diag "Exit code: ", $exit; fail($_); } elsif( $stderr ne "$_ syntax OK") { diag $stderr; diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-manifest.t libwww-mechanize-shell-perl-0.58/xt/99-manifest.t --- libwww-mechanize-shell-perl-0.57/xt/99-manifest.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-manifest.t 2019-09-30 08:03:13.000000000 +0000 @@ -7,8 +7,9 @@ use File::Spec; my @files = qw( MANIFEST MANIFEST.SKIP ); -plan tests => scalar @files * 4 +plan tests => scalar @files * 4 +1 # MANIFEST existence check + +1 # MYMETA.* non-existence check ; for my $file (@files) { @@ -19,13 +20,16 @@ is_deeply([grep(/^$/, @lines)],[], "No empty lines in $file"); is_deeply([grep(/^\s+$/, @lines)],[], "No whitespace-only lines in $file"); is_deeply([grep(/^\s*\S\s+$/, @lines)],[],"No trailing whitespace on lines in $file"); - + if ($file eq 'MANIFEST') { chomp @lines; is_deeply([grep { s/\s.*//; ! -f } @lines], [], "All files in $file exist") or do { diag "$_ is mentioned in $file but doesn't exist on disk" for grep { ! -f } @lines }; + + # Exclude some files from shipping + is_deeply([grep(/^MYMETA\.(yml|json)$/, @lines)],[],"We don't try to ship MYMETA.* $file"); }; - + close F; }; diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-minimumversion.t libwww-mechanize-shell-perl-0.58/xt/99-minimumversion.t --- libwww-mechanize-shell-perl-0.57/xt/99-minimumversion.t 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-minimumversion.t 2019-09-30 08:03:13.000000000 +0000 @@ -0,0 +1,18 @@ +#!perl -w +use strict; +use Test::More; + +eval { + #require Test::MinimumVersion::Fast; + require Test::MinimumVersion; + Test::MinimumVersion->import; +}; + +my @files; + +if ($@) { + plan skip_all => "Test::MinimumVersion required for testing minimum Perl version"; +} +else { + all_minimum_version_from_metajson_ok(); +} diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-synopsis.t libwww-mechanize-shell-perl-0.58/xt/99-synopsis.t --- libwww-mechanize-shell-perl-0.57/xt/99-synopsis.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-synopsis.t 2019-09-30 08:03:13.000000000 +0000 @@ -15,7 +15,8 @@ } sub wanted { - push @files, $File::Find::name if /\.p(l|m|od)$/; + push @files, $File::Find::name if /\.p(l|m|od)$/ + and $_ !~ /\bDSL\.pm$/; # we skip that one as it initializes immediately } sub synopsis_file_ok { @@ -46,5 +47,5 @@ skip "$file has no SYNOPSIS section", 1; }; }; - -} \ No newline at end of file + +} diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-test-prerequisites.t libwww-mechanize-shell-perl-0.58/xt/99-test-prerequisites.t --- libwww-mechanize-shell-perl-0.57/xt/99-test-prerequisites.t 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-test-prerequisites.t 2019-09-30 08:03:13.000000000 +0000 @@ -0,0 +1,121 @@ +#!perl -w + +use warnings; +use strict; +use Test::More; +use Data::Dumper; +use File::Find; + +=head1 DESCRIPTION + +This test checks whether all tests still pass when the optional test +prerequisites for the test are not present. + +This is done by using L<Test::Without::Module> to rerun the test while excluding +the optional prerequisite. + +=cut + +BEGIN { + eval { + require CPAN::Meta::Prereqs; + require Parse::CPAN::Meta; + require Perl::PrereqScanner::Lite; + require Module::CoreList; + require Test::Without::Module; + require Capture::Tiny; + Capture::Tiny->import('capture'); + require Path::Class; + Path::Class->import('dir'); + }; + if (my $err = $@) { + warn "# $err"; + plan skip_all => "Prerequisite needed for testing is missing"; + exit 0; + }; +}; + +my @tests; +if( @ARGV ) { + @tests = @ARGV; +} else { + open my $manifest, '<', 'MANIFEST' + or die "Couldn't read MANIFEST: $!"; + @tests = grep { -f $_ } grep { m!^(t/.*\.t|scripts/.*\.pl)$! } map { s!\s*$!!; $_ } <$manifest> +} +plan tests => 0+@tests; + +my $meta = Parse::CPAN::Meta->load_file('META.json'); + +# Find what META.* declares +my $explicit_test_prereqs = CPAN::Meta::Prereqs->new( $meta->{prereqs} )->merged_requirements->as_string_hash; +my $minimum_perl = $meta->{prereqs}->{runtime}->{requires}->{perl} || 5.006; + +sub distributed_packages { + my @modules; + for( @_ ) { + dir($_)->recurse( callback => sub { + my( $child ) = @_; + if( !$child->is_dir and $child =~ /\.pm$/) { + push @modules, ((scalar $child->slurp()) =~ m/^\s*package\s+(?:#.*?\n\s+)*(\w+(?:::\w+)*)\b/msg); + } + }); + }; + map { $_ => $_ } @modules; +} + +# Find what we distribute: +my %distribution = distributed_packages('blib','t'); + +my $scanner = Perl::PrereqScanner::Lite->new; +for my $test_file (@tests) { + my $implicit_test_prereqs = $scanner->scan_file($test_file)->as_string_hash; + my %missing = %{ $implicit_test_prereqs }; + #warn Dumper \%missing; + + for my $p ( keys %missing ) { + # remove core modules + if( Module::CoreList::is_core( $p, undef, $minimum_perl)) { + delete $missing{ $p }; + #diag "$p is core for $minimum_perl"; + } else { + #diag "$p is not in core for $minimum_perl"; + }; + + # remove explicit (test) prerequisites + for my $k (keys %$explicit_test_prereqs) { + delete $missing{ $k }; + }; + #warn Dumper $explicit_test_prereqs->as_string_hash; + + # Remove stuff from our distribution + for my $k (keys %distribution) { + delete $missing{ $k }; + }; + } + + # If we have no apparent missing prerequisites, we're good + my @missing = sort keys %missing; + + # Rerun the test without these modules and see whether it crashes + my @failed; + for my $candidate (@missing) { + diag "Checking that $candidate is not essential"; + my @cmd = ($^X, "-MTest::Without::Module=$candidate", "-Mblib", '-w', $test_file); + my $cmd = join " ", @cmd; + + my ($stdout, $stderr, $exit) = capture { + system( @cmd ); + }; + if( $exit != 0 ) { + push @failed, [ $candidate, [@cmd]]; + } elsif( $? != 0 ) { + push @failed, [ $candidate, [@cmd]]; + }; + }; + is 0+@failed, 0, $test_file + or diag Dumper \@failed; + +}; + +done_testing; diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-todo.t libwww-mechanize-shell-perl-0.58/xt/99-todo.t --- libwww-mechanize-shell-perl-0.57/xt/99-todo.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-todo.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,47 +1,47 @@ -use Test::More; -use File::Spec; -use File::Find; -use strict; - -# Check that all files do not contain any -# lines with "XXX" - such markers should -# either have been converted into Todo-stuff -# or have been resolved. -# The test was provided by Andy Lester. - -my @files; -my $blib = File::Spec->catfile(qw(blib lib)); -find(\&wanted, grep { -d } ($blib, 'bin')); -plan tests => 2* @files; -foreach my $file (@files) { - source_file_ok($file); -} - -sub wanted { - push @files, $File::Find::name if /\.p(l|m|od)$/; -} - -sub source_file_ok { - my $file = shift; - - open( my $fh, "<$file" ) or die "Can't open $file: $!"; - my @lines = <$fh>; - close $fh; - - my $n = 0; - for ( @lines ) { - ++$n; - s/^/$file ($n): /; - } - - my @x = grep /XXX/, @lines; - - if ( !is( scalar @x, 0, "Looking for XXXes in $file" ) ) { - diag( $_ ) for @x; - } - @x = grep /<<<|>>>/, @lines; - - if ( !is( scalar @x, 0, "Looking for <<<<|>>>> in $file" ) ) { - diag( $_ ) for @x; - } -} +use Test::More; +use File::Spec; +use File::Find; +use strict; + +# Check that all files do not contain any +# lines with "XXX" - such markers should +# either have been converted into Todo-stuff +# or have been resolved. +# The test was provided by Andy Lester. + +my @files; +my $blib = File::Spec->catfile(qw(blib lib)); +find(\&wanted, grep { -d } ($blib, 'bin')); +plan tests => 2* @files; +foreach my $file (@files) { + source_file_ok($file); +} + +sub wanted { + push @files, $File::Find::name if /\.p(l|m|od)$/; +} + +sub source_file_ok { + my $file = shift; + + open( my $fh, "<$file" ) or die "Can't open $file: $!"; + my @lines = <$fh>; + close $fh; + + my $n = 0; + for ( @lines ) { + ++$n; + s/^/$file ($n): /; + } + + my @x = grep /XXX/, @lines; + + if ( !is( scalar @x, 0, "Looking for XXXes in $file" ) ) { + diag( $_ ) for @x; + } + @x = grep /<<<|>>>/, @lines; + + if ( !is( scalar @x, 0, "Looking for <<<<|>>>> in $file" ) ) { + diag( $_ ) for @x; + } +} diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-unix-text.t libwww-mechanize-shell-perl-0.58/xt/99-unix-text.t --- libwww-mechanize-shell-perl-0.57/xt/99-unix-text.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-unix-text.t 2019-09-30 08:03:13.000000000 +0000 @@ -7,7 +7,7 @@ use File::Find; use strict; -my @files; +my @files = ('Makefile.PL', 'MANIFEST', 'MANIFEST.SKIP', glob 't/*.t'); my $blib = File::Spec->catfile(qw(blib lib)); find(\&wanted, grep { -d } ($blib, 'bin')); @@ -27,7 +27,7 @@ or die "Couldn't open '$filename' : $!\n"; binmode F; my $content = <F>; - + my $i; my @lines = grep { /\x0D\x0A$/sm } map { sprintf "%s: %s\x0A", $i++, $_ } split /\x0A/, $content; unless (is(scalar @lines, 0,"'$filename' contains no windows newlines")) { diff -Nru libwww-mechanize-shell-perl-0.57/xt/99-versions.t libwww-mechanize-shell-perl-0.58/xt/99-versions.t --- libwww-mechanize-shell-perl-0.57/xt/99-versions.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/99-versions.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,51 +1,51 @@ -#!perl -w - -# Stolen from ChrisDolan on use.perl.org -# http://use.perl.org/comments.pl?sid=29264&cid=44309 - -use warnings; -use strict; -use File::Find; -use Test::More; -BEGIN { - eval 'use File::Slurp; 1'; - if ($@) { - plan skip_all => "File::Slurp needed for testing"; - exit 0; - }; -}; - -plan 'no_plan'; - -my $last_version = undef; - -sub check { - return if (! m{blib/script/}xms && ! m{\.pm \z}xms); - - my $content = read_file($_); - - # only look at perl scripts, not sh scripts - return if (m{blib/script/}xms && $content !~ m/\A \#![^\r\n]+?perl/xms); - - my @version_lines = $content =~ m/ ( [^\n]* \$VERSION \s* = [^=] [^\n]* ) /gxms; - if (@version_lines == 0) { - fail($_); - } - for my $line (@version_lines) { - $line =~ s/^\s+//; - $line =~ s/\s+$//; - if (!defined $last_version) { - $last_version = shift @version_lines; - diag "Checking for $last_version"; - pass($_); - } else { - is($line, $last_version, $_); - } - } -} - -find({wanted => \&check, no_chdir => 1}, 'blib'); - -if (! defined $last_version) { - fail('Failed to find any files with $VERSION'); -} +#!perl -w + +# Stolen from ChrisDolan on use.perl.org +# http://use.perl.org/comments.pl?sid=29264&cid=44309 + +use warnings; +use strict; +use File::Find; +use Test::More; +BEGIN { + eval 'use File::Slurp; 1'; + if ($@) { + plan skip_all => "File::Slurp needed for testing"; + exit 0; + }; +}; + +plan 'no_plan'; + +my $last_version = undef; + +sub check { + return if (! m{blib/script/}xms && ! m{\.pm \z}xms); + + my $content = read_file($_); + + # only look at perl scripts, not sh scripts + return if (m{blib/script/}xms && $content !~ m/\A \#![^\r\n]+?perl/xms); + + my @version_lines = $content =~ m/ ( [^\n]* \$VERSION \s* = [^=] [^\n]* ) /gxms; + if (@version_lines == 0) { + fail($_); + } + for my $line (@version_lines) { + $line =~ s/^\s+//; + $line =~ s/\s+$//; + if (!defined $last_version) { + $last_version = shift @version_lines; + diag "Checking for $last_version"; + pass($_); + } else { + is($line, $last_version, $_); + } + } +} + +find({wanted => \&check, no_chdir => 1}, 'blib'); + +if (! defined $last_version) { + fail('Failed to find any files with $VERSION'); +} diff -Nru libwww-mechanize-shell-perl-0.57/xt/meta-lint.t libwww-mechanize-shell-perl-0.58/xt/meta-lint.t --- libwww-mechanize-shell-perl-0.57/xt/meta-lint.t 2018-06-04 19:55:33.000000000 +0000 +++ libwww-mechanize-shell-perl-0.58/xt/meta-lint.t 2019-09-30 08:03:13.000000000 +0000 @@ -1,36 +1,48 @@ -#!perl -w - -# Stolen from ChrisDolan on use.perl.org -# http://use.perl.org/comments.pl?sid=29264&cid=44309 - -use warnings; -use strict; -use File::Find; -use Test::More tests => 4; -use Parse::CPAN::Meta; -use CPAN::Meta::Validator; - -use lib '.'; -use vars '%module'; -require 'Makefile.PL'; -# Loaded from Makefile.PL -%module = get_module_info(); -my $module = $module{NAME}; - -(my $file = $module) =~ s!::!/!g; -require "$file.pm"; - -my $version = sprintf '%0.2f', $module->VERSION; - -for my $meta_file ('META.yml', 'META.json') { - my $meta = Parse::CPAN::Meta->load_file($meta_file); - - my $cmv = CPAN::Meta::Validator->new( $meta ); - - if(! ok $cmv->is_valid, "$meta_file is valid" ) { - diag $_ for $cmv->errors; - }; - - # Also check that the declared version matches the version in META.* - is $meta->{version}, $version, "$meta_file version matches module version ($version)"; -}; +#!perl -w + +# Stolen from ChrisDolan on use.perl.org +# http://use.perl.org/comments.pl?sid=29264&cid=44309 + +use warnings; +use strict; +use File::Find; +use Test::More; + +eval { + #require Test::MinimumVersion::Fast; + require Parse::CPAN::Meta; + Parse::CPAN::Meta->import(); + require CPAN::Meta::Validator; + CPAN::Meta::Validator->import(2.15); +}; +if ($@) { + plan skip_all => "CPAN::Meta::Validator version 2.15 required for testing META files"; +} +else { + plan tests => 4; +} + +use lib '.'; +our %module; +require 'Makefile.PL'; +# Loaded from Makefile.PL +%module = get_module_info(); +my $module = $module{NAME}; + +(my $file = $module) =~ s!::!/!g; +require "$file.pm"; + +my $version = sprintf '%0.2f', $module->VERSION; + +for my $meta_file ('META.yml', 'META.json') { + my $meta = Parse::CPAN::Meta->load_file($meta_file); + + my $cmv = CPAN::Meta::Validator->new( $meta ); + + if(! ok $cmv->is_valid, "$meta_file is valid" ) { + diag $_ for $cmv->errors; + }; + + # Also check that the declared version matches the version in META.* + is $meta->{version}, $version, "$meta_file version matches module version ($version)"; +};