r63541 - in /branches/upstream/libwww-mechanize-shell-perl/current: ./ lib/WWW/Mechanize/ t/
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Sun Oct 10 19:47:47 UTC 2010
Author: angelabad-guest
Date: Sun Oct 10 19:47:29 2010
New Revision: 63541
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63541
Log:
[svn-upgrade] new version libwww-mechanize-shell-perl (0.50)
Added:
branches/upstream/libwww-mechanize-shell-perl/current/.gitignore
branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t (with props)
branches/upstream/libwww-mechanize-shell-perl/current/t/99-changes.t
branches/upstream/libwww-mechanize-shell-perl/current/t/99-versions.t
branches/upstream/libwww-mechanize-shell-perl/current/t/source.mech
Removed:
branches/upstream/libwww-mechanize-shell-perl/current/t/10-nonexistent-host.t
Modified:
branches/upstream/libwww-mechanize-shell-perl/current/Changes
branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST
branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST.skip
branches/upstream/libwww-mechanize-shell-perl/current/META.yml
branches/upstream/libwww-mechanize-shell-perl/current/README
branches/upstream/libwww-mechanize-shell-perl/current/lib/WWW/Mechanize/Shell.pm
branches/upstream/libwww-mechanize-shell-perl/current/t/14-command-identity.t
branches/upstream/libwww-mechanize-shell-perl/current/t/99-manifest.t
branches/upstream/libwww-mechanize-shell-perl/current/t/99-pod.t
branches/upstream/libwww-mechanize-shell-perl/current/t/99-todo.t
branches/upstream/libwww-mechanize-shell-perl/current/t/99-unix-text.t
Added: branches/upstream/libwww-mechanize-shell-perl/current/.gitignore
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/.gitignore?rev=63541&op=file
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/.gitignore (added)
+++ branches/upstream/libwww-mechanize-shell-perl/current/.gitignore Sun Oct 10 19:47:29 2010
@@ -1,0 +1,12 @@
+Makefile
+Makefile.old
+*.tar.gz
+*.bak
+pm_to_blib
+blib/
+WWW-Mechanize-Shell-*
+WWW-Mechanize-Shell-*/
+.releaserc
+.lwpcookies
+META.yml
+CVS
Modified: branches/upstream/libwww-mechanize-shell-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/Changes?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/Changes (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/Changes Sun Oct 10 19:47:29 2010
@@ -5,11 +5,25 @@
+ Check how the new WWW::Mechanize JavaScript handling interacts with the
shells own JS blocking (badly, I guess)
+ Use Scalar::Util::weaken if available
- + Spin off HTML::Display into its own distribution
+ 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
+
+0.50 20100821
+ . 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
+
+0.49 20100817
+ + 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
+ Addresses [rt.cpan.org #59883]
0.48 20081109
+ More test fixes for incompatibilities between LWP and Mechanize 1.34+
@@ -72,7 +86,7 @@
- Bumped module version
- Fix for RT 22121 - shell does not start
-0.38 200612xx
+0.38 20061214
- Bumped module version
- Added a test for HTML::TableExtract functionality
which went untested so far
Modified: branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST Sun Oct 10 19:47:29 2010
@@ -1,53 +1,57 @@
-Changes
-MANIFEST This list of files
-MANIFEST.skip
-README
-Makefile.PL
-lib/WWW/Mechanize/Shell.pm
-bin/banking.postbank.de.mech
-bin/hotmail.signup.mech
-bin/wwwshell.pl
-inc/Test/HTTP/LocalServer.pm
-inc/Test/HTTP/log-server
-inc/IO/Catch.pm
-t/00-use.t
-t/00a-Term-Shell-catch-smry.t
-t/01-fallback-Win32-OLE.t
-t/02-fallback-HTML-TableExtract.t
-t/02-fallback-Pod-Constant.t
-t/03-documentation.t
-t/04-history-invariant.t
-t/05-options.t
-t/06-valid-output.t
-t/07-history-items.t
-t/08-unknown-command.t
-t/09-invalid-filename.t
-t/10-nonexistent-host.t
-t/11-browse-without-request.t
-t/12-comments.t
-t/13-command-au.t
-t/14-command-identity.t
-t/15-history-save.t
-t/16-form-fillout.t
-t/17-eval-multiline.t
-t/18-browser-autosync.t
-t/19-value-multi.t
-t/20-restart-without-script.t
-t/21-autofill-re.t
-t/22-complete-command.t
-t/23-check-dumpresponses.t
-t/24-source-file.t
-t/25-save-file-nolink.t
-t/26-form-no-form.t
-t/27-form_number.t
-t/27-index.html
-t/28-html-tableextract.t
-t/28-cmd-title.t
-t/29-launch-shell.t
-t/401-server
-t/98-bin.t
-t/99-pod.t
-t/99-todo.t
-t/99-unix-text.t
-t/99-manifest.t
-META.yml Module meta-data (added by MakeMaker)
+.gitignore
+bin/banking.postbank.de.mech
+bin/hotmail.signup.mech
+bin/wwwshell.pl
+Changes
+inc/IO/Catch.pm
+inc/Test/HTTP/LocalServer.pm
+inc/Test/HTTP/log-server
+lib/WWW/Mechanize/Shell.pm
+Makefile.PL
+MANIFEST This list of files
+MANIFEST.skip
+META.yml Module meta-data (added by MakeMaker)
+README
+t/00-use.t
+t/00a-Term-Shell-catch-smry.t
+t/01-fallback-Win32-OLE.t
+t/02-fallback-HTML-TableExtract.t
+t/02-fallback-Pod-Constant.t
+t/03-documentation.t
+t/04-history-invariant.t
+t/05-options.t
+t/06-valid-output.t
+t/07-history-items.t
+t/08-unknown-command.t
+t/09-invalid-filename.t
+t/11-browse-without-request.t
+t/12-comments.t
+t/13-command-au.t
+t/14-command-identity.t
+t/15-history-save.t
+t/16-form-fillout.t
+t/17-eval-multiline.t
+t/18-browser-autosync.t
+t/19-value-multi.t
+t/20-restart-without-script.t
+t/21-autofill-re.t
+t/22-complete-command.t
+t/23-check-dumpresponses.t
+t/24-source-file.t
+t/25-save-file-nolink.t
+t/26-form-no-form.t
+t/27-form_number.t
+t/27-index.html
+t/28-cmd-headers.t
+t/28-cmd-title.t
+t/28-html-tableextract.t
+t/29-launch-shell.t
+t/401-server
+t/98-bin.t
+t/99-changes.t
+t/99-manifest.t
+t/99-pod.t
+t/99-todo.t
+t/99-unix-text.t
+t/99-versions.t
+t/source.mech
Modified: branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST.skip
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST.skip?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST.skip (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/MANIFEST.skip Sun Oct 10 19:47:29 2010
@@ -5,10 +5,12 @@
WWW-Mechanize-Shell-*
WWW-Mechanize-Shell-*/
CVS/
+.git/
+MANIFEST.bak
pm_to_blib
pm_to_blib.ts
cvstest
-Makefile
+Makefile$
cover_db/
blibdirs.ts
perlbug.rep
Modified: branches/upstream/libwww-mechanize-shell-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/META.yml?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/META.yml (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/META.yml Sun Oct 10 19:47:29 2010
@@ -1,22 +1,30 @@
--- #YAML:1.0
-name: WWW-Mechanize-Shell
-version: 0.48
-abstract: An interactive shell for WWW::Mechanize
-license: ~
-author:
+name: WWW-Mechanize-Shell
+version: 0.50
+abstract: An interactive shell for WWW::Mechanize
+author:
- Max Maischein <corion at cpan.org>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
- Hook::LexWrap: 0.2
- HTML::Display: 0
- HTML::TokeParser::Simple: 2
- LWP: 5.69
- Term::Shell: 0.02
- Test::Harness: 2.3
- URI::URL: 0
- WWW::Mechanize: 1.2
- WWW::Mechanize::FormFiller: 0.05
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Hook::LexWrap: 0.2
+ HTML::Display: 0
+ HTML::TokeParser::Simple: 2
+ LWP: 5.69
+ Term::Shell: 0.02
+ Test::Harness: 2.3
+ URI::URL: 0
+ WWW::Mechanize: 1.2
+ WWW::Mechanize::FormFiller: 0.05
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.50
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libwww-mechanize-shell-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/README?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/README (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/README Sun Oct 10 19:47:29 2010
@@ -42,4 +42,4 @@
You can use this shell under the same terms as Perl itself
-Copyright (C) 2002,2003 Max Maischein (corion at cpan.org)
+Copyright (C) 2002,2010 Max Maischein (corion at cpan.org)
Modified: branches/upstream/libwww-mechanize-shell-perl/current/lib/WWW/Mechanize/Shell.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/lib/WWW/Mechanize/Shell.pm?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/lib/WWW/Mechanize/Shell.pm (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/lib/WWW/Mechanize/Shell.pm Sun Oct 10 19:47:29 2010
@@ -15,7 +15,7 @@
use B::Deparse;
use vars qw( $VERSION @EXPORT %munge_map );
-$VERSION = '0.48';
+$VERSION = '0.50';
@EXPORT = qw( &shell );
=head1 NAME
@@ -318,7 +318,13 @@
};
sub request_dumper { print $_[1]->as_string };
-sub response_dumper { print $_[1]->as_string };
+sub response_dumper {
+ if (ref $_[1] eq 'ARRAY') {
+ print $_[1]->[0]->as_string;
+ } else {
+ print $_[1]->as_string;
+ }
+};
sub re_or_string {
my ($self,$arg) = @_;
@@ -1961,7 +1967,7 @@
=head1 ONLINE HELP
The online help feature is currently a bit broken in C<Term::Shell>,
-but a fix is in the works. Until then, you can reenable the
+but a fix is in the works. Until then, you can re-enable the
dynamic online help by patching C<Term::Shell> :
Remove the three lines
@@ -2030,11 +2036,21 @@
perl -MWWW::Mechanize::Shell -e"shell"
+=head1 REPOSITORY
+
+The public repository of this module is
+L<http://github.com/Corion/WWW-Mechanize-Shell>.
+
+=head1 SUPPORT
+
+The public support forum of this module is
+L<http://perlmonks.org/>.
+
=head1 COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
-Copyright (C) 2002,2008 Max Maischein
+Copyright (C) 2002,2010 Max Maischein
=head1 AUTHOR
@@ -2044,6 +2060,6 @@
=head1 SEE ALSO
-L<WWW::Mechanize>,L<WWW::Mechanize::FormFiller>
-
-=cut
+L<WWW::Mechanize>,L<WWW::Mechanize::FormFiller>,L<WWW::Mechanize::Firefox>
+
+=cut
Modified: branches/upstream/libwww-mechanize-shell-perl/current/t/14-command-identity.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/14-command-identity.t?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/14-command-identity.t (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/14-command-identity.t Sun Oct 10 19:47:29 2010
@@ -258,11 +258,11 @@
s!\b$code_port\b!$script_port!smg for ($script, $code_output);
#print STDERR "Releasing hook";
undef $s->{request_wrapper};
- {
- local *WWW::Mechanize::Shell::request_dumper = sub { die };
- use HTTP::Request::Common;
- $s->agent->request(GET 'http://google.de/');
- };
+ #{
+ # local *WWW::Mechanize::Shell::request_dumper = sub { die };
+ # use HTTP::Request::Common;
+ # $s->agent->request(GET 'http://google.de/');
+ #};
$s->release_agent;
undef $s;
Added: branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t?rev=63541&op=file
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t (added)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t Sun Oct 10 19:47:29 2010
@@ -1,0 +1,84 @@
+#!/usr/bin/perl -w
+use strict;
+use lib 'inc';
+use IO::Catch;
+
+use vars qw($_STDOUT_);
+tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!;
+
+# Disable all ReadLine functionality
+$ENV{PERL_RL} = 0;
+delete $ENV{PAGER}
+ if $ENV{PAGER};
+$ENV{PERL_HTML_DISPLAY_CLASS}="HTML::Display::Dump";
+
+use Test::More tests => 8;
+
+use_ok('WWW::Mechanize::Shell');
+my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef );
+isa_ok $s, 'WWW::Mechanize::Shell';
+
+sub cleanup() {
+ # clean up $_STDOUT_ so it fits on one line
+ #diag $_STDOUT_;
+ $_STDOUT_ =~ s/[\r\n]+/|/g;
+ $_STDOUT_ =~ s!(?<=:)(\s+)!(">" x (length($1)/2))!eg;
+};
+
+SKIP: {
+
+ $s->agent->{base} = 'http://example.com';
+ $s->agent->update_html(<<HTML);
+ <html>
+ <head><base href="http://example.com" />
+ <title>An HTML page</title>
+ </head>
+ <body>
+ <h1>(H1.1)</h1>
+ <h2>(H2)</h2>
+ <h3>(H3.1)</h3>
+ <h3>(H3.2)</h3>
+ <h4>(H4)</h4>
+ <h1>(H1.2)</h1>
+ <h5>(H5)</h5>
+ <h1></h1>
+ <h1> Some spaces before this</h1>
+ <h1>
+A newline in
+this</h1>
+ <h2>
+ <h3>
+ </body>
+ </html>
+HTML
+ $s->cmd('headers');
+ cleanup;
+ is($_STDOUT_,"h1:(H1.1)|h2:>(H2)|h3:>>(H3.1)|h3:>>(H3.2)|h4:>>>(H4)|h1:(H1.2)|h5:>>>>(H5)|h1:<no text>|h1:Some spaces before this|h1:A newline in this|h2:><empty tag>|h3:>><empty tag>|", "The default works");
+ undef $_STDOUT_;
+
+ $s->cmd('headers 12345');
+ cleanup;
+ is($_STDOUT_,"h1:(H1.1)|h2:>(H2)|h3:>>(H3.1)|h3:>>(H3.2)|h4:>>>(H4)|h1:(H1.2)|h5:>>>>(H5)|h1:<no text>|h1:Some spaces before this|h1:A newline in this|h2:><empty tag>|h3:>><empty tag>|", "Explicitly specifying the default works as well");
+ undef $_STDOUT_;
+
+ $s->cmd('headers 1');
+ cleanup;
+ is($_STDOUT_,"h1:(H1.1)|h1:(H1.2)|h1:<no text>|h1:Some spaces before this|h1:A newline in this|", "H1 headers works as well");
+ undef $_STDOUT_;
+
+ $s->cmd('headers 23');
+ cleanup;
+ is($_STDOUT_,"h2:>(H2)|h3:>>(H3.1)|h3:>>(H3.2)|h2:><empty tag>|h3:>><empty tag>|", "Restricting to a subset works too");
+ undef $_STDOUT_;
+
+ $s->cmd('headers 25');
+ cleanup;
+ is($_STDOUT_,"h2:>(H2)|h5:>>>>(H5)|h2:><empty tag>|", "A noncontingous subset as well");
+ undef $_STDOUT_;
+
+ $s->cmd('headers 52');
+ cleanup;
+ is($_STDOUT_,"h2:>(H2)|h5:>>>>(H5)|h2:><empty tag>|", "Even in a weirdo order");
+ undef $_STDOUT_;
+
+};
Propchange: branches/upstream/libwww-mechanize-shell-perl/current/t/28-cmd-headers.t
------------------------------------------------------------------------------
svn:executable = *
Added: branches/upstream/libwww-mechanize-shell-perl/current/t/99-changes.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-changes.t?rev=63541&op=file
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-changes.t (added)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-changes.t Sun Oct 10 19:47:29 2010
@@ -1,0 +1,28 @@
+#!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
+
+my $module = 'WWW::Mechanize::Shell';
+
+(my $file = $module) =~ s!::!/!g;
+require "$file.pm";
+
+my $version = sprintf '%0.2f', $module->VERSION;
+diag "Checking for version " . $version;
+
+my $changes = do { local $/; open my $fh, 'Changes' or die $!; <$fh> };
+
+ok $changes =~ /^(.*$version.*)$/m, "We find version $version";
+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;
Modified: branches/upstream/libwww-mechanize-shell-perl/current/t/99-manifest.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-manifest.t?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-manifest.t (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-manifest.t Sun Oct 10 19:47:29 2010
@@ -7,7 +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
+ ;
for my $file (@files) {
ok(-f $file, "$file exists");
@@ -17,6 +19,13 @@
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 };
+ };
+
close F;
};
Modified: branches/upstream/libwww-mechanize-shell-perl/current/t/99-pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-pod.t?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-pod.t (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-pod.t Sun Oct 10 19:47:29 2010
@@ -24,7 +24,7 @@
}
else {
my $blib = File::Spec->catfile(qw(blib lib));
- find(\&wanted, $blib, 'bin');
+ find(\&wanted, grep { -d } ($blib, 'bin'));
plan tests => scalar @files;
foreach my $file (@files) {
pod_file_ok($file);
Modified: branches/upstream/libwww-mechanize-shell-perl/current/t/99-todo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-todo.t?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-todo.t (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-todo.t Sun Oct 10 19:47:29 2010
@@ -11,8 +11,8 @@
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
-find(\&wanted, $blib, 'bin');
-plan tests => scalar @files;
+find(\&wanted, grep { -d } ($blib, 'bin'));
+plan tests => 2* @files;
foreach my $file (@files) {
source_file_ok($file);
}
@@ -39,4 +39,9 @@
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;
+ }
}
Modified: branches/upstream/libwww-mechanize-shell-perl/current/t/99-unix-text.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-unix-text.t?rev=63541&op=diff
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-unix-text.t (original)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-unix-text.t Sun Oct 10 19:47:29 2010
@@ -10,7 +10,7 @@
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
-find(\&wanted, $blib, 'bin');
+find(\&wanted, grep { -d } ($blib, 'bin'));
plan tests => scalar @files;
foreach my $file (@files) {
unix_file_ok($file);
Added: branches/upstream/libwww-mechanize-shell-perl/current/t/99-versions.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/99-versions.t?rev=63541&op=file
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/99-versions.t (added)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/99-versions.t Sun Oct 10 19:47:29 2010
@@ -1,0 +1,49 @@
+#!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) {
+ 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');
+}
Added: branches/upstream/libwww-mechanize-shell-perl/current/t/source.mech
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-mechanize-shell-perl/current/t/source.mech?rev=63541&op=file
==============================================================================
--- branches/upstream/libwww-mechanize-shell-perl/current/t/source.mech (added)
+++ branches/upstream/libwww-mechanize-shell-perl/current/t/source.mech Sun Oct 10 19:47:29 2010
@@ -1,0 +1,2 @@
+# a test file
+content
More information about the Pkg-perl-cvs-commits
mailing list