Skip to content

Commit a614f1f

Browse files
committed
Revert "work around Perl/perl5#20207"
This (partially) reverts commit a8cc883.
1 parent 5c8228f commit a614f1f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

t/25_tie_handle_argv.t

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ our $FE = $] ge '5.012' && $] lt '5.029007' ? !!0 : !!1; # FE="first eof", see h
4242
#TODO Later: Why is $BE needed here, but not in the ::Inplace tests?
4343
our $BE; # BE="buggy eof", Perl 5.14.x had several regressions regarding eof (and a few others) (gets set below)
4444
our $CE; # CE="can't eof()", Perl <5.12 doesn't support eof() on tied filehandles (gets set below)
45-
# plus try to work around https://github.com/Perl/perl5/issues/20207 on >5.36
4645
our $FL = undef; # FL="First Line"
4746
# Apparently there are some versions of Perl on Win32 where the following two appear to work slightly differently.
4847
# I've seen differing results on different systems and I'm not sure why, so I set it dynamically... not pretty, but this test isn't critical.
@@ -68,7 +67,7 @@ sub testboth { ## no critic (RequireArgUnpacking)
6867
}
6968
{
7069
local (*ARGV, $.); ## no critic (RequireInitializationForLocalVars)
71-
local $CE = $] lt '5.012' || $] gt '5.036';
70+
local $CE = $] lt '5.012';
7271
local $BE = $] ge '5.014' && $] lt '5.016';
7372
tie *ARGV, 'Tie::Handle::Argv', debug=>$DEBUG;
7473
my $osi = defined($stdin) ? OverrideStdin->new($stdin) : undef;
@@ -97,7 +96,7 @@ testboth 'basic test' => sub { plan tests=>1;
9796
};
9897

9998
testboth 'basic test with eof()' => sub {
100-
plan $CE ? ( skip_all=>"eof() not supported on tied handles on Perl<5.12 or >5.36" ) : (tests=>1);
99+
plan $CE ? ( skip_all=>"eof() not supported on tied handles on Perl<5.12" ) : (tests=>1);
101100
my @tf = (newtempfn("Foo\nBar"), newtempfn("Quz\nBaz\n"));
102101
my @states;
103102
local @ARGV = @tf; # this also tests "local"ization after constructing the object
@@ -269,7 +268,7 @@ testboth 'restart with emptied @ARGV (STDIN)' => sub {
269268
push @states, [[@ARGV], $ARGV, defined(fileno ARGV), $., eof, $_] while <>;
270269
push @states, [[@ARGV], $ARGV, defined(fileno ARGV), $., eof];
271270
SKIP: {
272-
skip "eof() not supported on tied handles on Perl<5.12 or >5.36", 1 if $CE;
271+
skip "eof() not supported on tied handles on Perl<5.12", 1 if $CE;
273272
ok !eof(), 'eof() is false';
274273
}
275274
push @states, [[@ARGV], $ARGV, defined(fileno ARGV), $., eof];

t/50_inplace.t

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use warnings FATAL => qw/ io inplace /;
4747
our $DEBUG = 0;
4848
our $FE = $] ge '5.012' && $] lt '5.029007' ? !!0 : !!1; # FE="first eof", see https://github.com/Perl/perl5/issues/16786
4949
our $CE; # CE="can't eof()", Perl <5.12 doesn't support eof() on tied filehandles (gets set below)
50-
# plus try to work around https://github.com/Perl/perl5/issues/20207 on >5.36
5150
our $FL = undef; # FL="First Line"
5251
# Apparently there are some versions of Perl on Win32 where the following two appear to work slightly differently.
5352
# I've seen differing results on different systems and I'm not sure why, so I set it dynamically... not pretty, but this test isn't critical.
@@ -87,7 +86,7 @@ sub testboth { ## no critic (RequireArgUnpacking)
8786
{
8887
local $TESTMODE = 'Inplace';
8988
local (*ARGV, *ARGVOUT, $., $^I); ## no critic (RequireInitializationForLocalVars)
90-
local $CE = $] lt '5.012' || $] gt '5.036';
89+
local $CE = $] lt '5.012';
9190
my $inpl = File::Replace::Inplace->new(debug=>$DEBUG, %$args);
9291
my $osi = defined($stdin) ? OverrideStdin->new($stdin) : undef;
9392
subtest "$name - ::Inplace" => $sub;
@@ -122,7 +121,7 @@ testboth 'basic test' => sub { plan tests=>9;
122121
};
123122

124123
testboth 'basic test with eof()' => sub {
125-
if ($CE) { plan skip_all=>"eof() not supported on tied handles on Perl<5.12 or >5.36" }
124+
if ($CE) { plan skip_all=>"eof() not supported on tied handles on Perl<5.12" }
126125
elsif ($^O eq 'MSWin32') { plan skip_all=>"eof() acts differently on Win32" }
127126
else { plan tests=>9 }
128127
my @tf = (newtempfn("Foo\nBar"), newtempfn("Quz\nBaz\n"));
@@ -371,7 +370,7 @@ testboth 'restart with emptied @ARGV (STDIN)' => sub {
371370
push @states, [[@ARGV], $ARGV, defined(fileno ARGV), defined(fileno ARGVOUT), $., eof];
372371
is select(), 'main::STDOUT', 'STDOUT is selected in between';
373372
SKIP: {
374-
skip "eof() not supported on tied handles on Perl<5.12 or >5.36", 2 if $CE;
373+
skip "eof() not supported on tied handles on Perl<5.12", 2 if $CE;
375374
ok !eof(), 'eof() is false';
376375
is select(), 'main::STDOUT', 'STDOUT is still selected';
377376
}
@@ -474,7 +473,7 @@ subtest 'create option' => sub { plan tests=>9;
474473

475474
subtest 'premature destroy' => sub { plan tests=>7;
476475
local (*ARGV, *ARGVOUT, $., $^I); ## no critic (RequireInitializationForLocalVars)
477-
local $CE = $] lt '5.012' || $] gt '5.036';
476+
local $CE = $] lt '5.012';
478477
is grep( {/\bunclosed file\b.+\bnot replaced\b/i} warns {
479478
my $tfn = newtempfn("IJK\nMNO");
480479
@ARGV = ($tfn); ## no critic (RequireLocalizedPunctuationVars)

0 commit comments

Comments
 (0)