[libhtml-scrubber-perl] 11/30: Replace bareword filehandles with lexicals
Florian Schlichting
fsfs at moszumanska.debian.org
Sat Nov 11 13:46:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
fsfs pushed a commit to annotated tag release/0.16
in repository libhtml-scrubber-perl.
commit af37c6b3c363e7601c2003ec60b6c5e360c573b8
Author: Paul Cochrane <paul at liekut.de>
Date: Wed Jun 14 12:25:32 2017 +0200
Replace bareword filehandles with lexicals
---
t/06_scrub_file.t | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/t/06_scrub_file.t b/t/06_scrub_file.t
index ee5e707..c01790d 100644
--- a/t/06_scrub_file.t
+++ b/t/06_scrub_file.t
@@ -25,18 +25,17 @@ SKIP: {
$r = "Error: \$@=$@ \$!=$!" unless $r;
is( $r, 1, "scrub(\$html,\$tmpfile=$tmpfile)" );
- local *FILIS;
- open FILIS, "+>", $tmpfile or die "can't write to $tmpfile";
+ open my $filis, "+>", $tmpfile or die "can't write to $tmpfile";
- $r = $s->scrub( $html, \*FILIS );
+ $r = $s->scrub( $html, $filis );
$r = "Error: \$@=$@ \$!=$!" unless $r;
- is( $r, 1, q[scrub($html,\*FILIS)] );
+ is( $r, 1, q[scrub($html, $filis)] );
- seek *FILIS, 0, 0;
- $r = join '', readline *FILIS;
- is( $r, "histart mid1 mid2 end", "FILIS has the right stuff" );
- is( close(FILIS), 1, q[close(FILIS)] );
+ seek $filis, 0, 0;
+ $r = join '', readline $filis;
+ is( $r, "histart mid1 mid2 end", '$filis has the right stuff' );
+ is( close($filis), 1, q[close($filis)] );
my ( $tfh2, $tmpfile2 ) = tempfile( $template, DIR => $tmpdir, SUFFIX => '.html' );
$r = $s->scrub_file( $tmpfile, "$tmpfile2" );
@@ -44,14 +43,14 @@ SKIP: {
is( $r, 1, qq[scrub_file(\$tmpfile,"\$tmpfile2"=$tmpfile2)] );
- open FILIS, "+>", $tmpfile2 or die "can't write to $tmpfile";
- $r = $s->scrub_file( $tmpfile, \*FILIS );
+ open $filis, "+>", $tmpfile2 or die "can't write to $tmpfile";
+ $r = $s->scrub_file( $tmpfile, $filis );
$r = "Error: \$@=$@ \$!=$!" unless $r;
- is( $r, 1, q[scrub_file($tmpfile,\*FILIS)] );
- seek *FILIS, 0, 0;
- $r = join '', readline *FILIS;
- is( $r, "histart mid1 mid2 end", "FILIS has the right stuff" );
- is( close(FILIS), 1, q[close(FILIS)] );
+ is( $r, 1, q[scrub_file($tmpfile, $filis)] );
+ seek $filis, 0, 0;
+ $r = join '', readline $filis;
+ is( $r, "histart mid1 mid2 end", '$filis has the right stuff' );
+ is( close($filis), 1, q[close($filis)] );
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libhtml-scrubber-perl.git
More information about the Pkg-perl-cvs-commits
mailing list