Repository: lucy Updated Branches: refs/heads/master fd955dd5c -> cb07bc532
Prepare for removal of CGI in Perl 5.22. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/cb07bc53 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/cb07bc53 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/cb07bc53 Branch: refs/heads/master Commit: cb07bc532f77821a3768e0bdc63877a322056247 Parents: 35d600a Author: Marvin Humphrey <[email protected]> Authored: Mon Aug 18 17:43:19 2014 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Wed Aug 20 17:13:48 2014 -0700 ---------------------------------------------------------------------- perl/t/binding/702-sample.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/cb07bc53/perl/t/binding/702-sample.t ---------------------------------------------------------------------- diff --git a/perl/t/binding/702-sample.t b/perl/t/binding/702-sample.t index 6d1b1e3..eafbc54 100644 --- a/perl/t/binding/702-sample.t +++ b/perl/t/binding/702-sample.t @@ -16,7 +16,17 @@ use strict; use warnings; use lib 'buildlib'; -use Test::More tests => 1; +use Test::More; +BEGIN { + no warnings 'deprecated'; + eval 'use CGI;'; + if ($@) { + plan( skip_all => 'no CGI' ); + } + else { + plan( tests => 1 ); + } +} use File::Spec::Functions qw( catfile catdir ); use File::Path qw( rmtree ); @@ -39,6 +49,7 @@ for my $filename (qw( search.cgi indexer.pl )) { or die "no match"; my $uscon_source = catdir(qw( sample us_constitution )); $content =~ s/(uscon_source\s+=\s+).*?;/$1'$uscon_source';/; + $content =~ s/(^use warnings;\n)/$1no warnings 'deprecated';\n/m; $content =~ s/^use/$use_dirs;\nuse/m; open( $fh, '>', "_$filename" ) or die $!; print $fh $content;
