Skip to content

Commit 75f3df8

Browse files
committed
Use File::Slurp, instead of our own home-grown version.
Requires adjustments to several of the tests, to normalize "end-of-line at end-of-file", but we'll just `chomp()` those away.
1 parent 4a31c74 commit 75f3df8

17 files changed

+21
-39
lines changed

Build.PL

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ $build_pkg->new(
5757
'recommends' => {
5858
'JavaScript::Minifier::XS' => 0,
5959
},
60+
'test_requires' => {
61+
'File::Slurp' => 0,
62+
},
6063
# add configuration requirements both to build_requires and to META.yml,
6164
# until M::B supports "configure_requires" directly.
6265
'build_requires' => { %configure_requires },

MANIFEST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ t/htdocs/test.js
2323
t/htdocs/test.txt
2424
t/htdocs/minified.txt
2525
t/htdocs/minified-xs.txt
26-
t/MY/slurp.pm
2726
t/MY/CharsetHandler.pm
2827
t/MY/JSHandler.pm
2928
t/MY/NoCTypeHandler.pm

t/MY/CharsetHandler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Apache2::RequestRec qw();
77
use Apache2::RequestUtil qw();
88
use Apache2::Const -compile => qw(OK);
99
use File::Spec::Functions qw(catfile);
10-
use MY::slurp;
10+
use File::Slurp qw(slurp);
1111

1212
sub handler {
1313
my $r = shift;

t/MY/JSHandler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Apache2::RequestRec qw();
77
use Apache2::RequestUtil qw();
88
use Apache2::Const -compile => qw(OK);
99
use File::Spec::Functions qw(catfile);
10-
use MY::slurp;
10+
use File::Slurp qw(slurp);
1111

1212
sub handler {
1313
my $r = shift;

t/MY/NoCTypeHandler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Apache2::RequestRec qw();
77
use Apache2::RequestUtil qw();
88
use Apache2::Const -compile => qw(OK);
99
use File::Spec::Functions qw(catfile);
10-
use MY::slurp;
10+
use File::Slurp qw(slurp);
1111

1212
sub handler {
1313
my $r = shift;

t/MY/PlainHandler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Apache2::RequestRec qw();
77
use Apache2::RequestUtil qw();
88
use Apache2::Const -compile => qw(OK);
99
use File::Spec::Functions qw(catfile);
10-
use MY::slurp;
10+
use File::Slurp qw(slurp);
1111

1212
sub handler {
1313
my $r = shift;

t/MY/slurp.pm

Lines changed: 0 additions & 16 deletions
This file was deleted.

t/content-type.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Apache::Test;
44
use Apache::TestRequest;
55
use Apache::TestUtil qw(t_cmp);
66
use lib 't';
7-
use MY::slurp;
7+
use File::Slurp qw(slurp);
88

99
# Test "Content-Type" headers
1010
plan tests => 2, need_lwp;
@@ -13,7 +13,6 @@ plan tests => 2, need_lwp;
1313
charset_minified: {
1414
my $body = GET_BODY '/content-type/charset';
1515
my $min = slurp( 't/htdocs/minified.txt' );
16-
chomp($min);
1716

1817
ok( t_cmp($body, $min) );
1918
}

t/decline.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Apache::Test;
44
use Apache::TestRequest;
55
use Apache::TestUtil qw(t_cmp);
66
use lib 't';
7-
use MY::slurp;
7+
use File::Slurp qw(slurp);
88

99
# Test non-JS responses still have other filters applied
1010
plan tests => 1, need_lwp;

t/dynamic.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Apache::Test;
44
use Apache::TestRequest;
55
use Apache::TestUtil qw(t_cmp);
66
use lib 't';
7-
use MY::slurp;
7+
use File::Slurp qw(slurp);
88

99
# Test dynamically generated content
1010
plan tests => 2, need_lwp;
@@ -20,6 +20,5 @@ dynamic_unaltered: {
2020
dynamic_minified: {
2121
my $body = GET_BODY '/dynamic/js';
2222
my $min = slurp( 't/htdocs/minified.txt' );
23-
chomp($min);
2423
ok( t_cmp($body, $min) );
2524
}

0 commit comments

Comments
 (0)