Skip to content

Commit 0eda12c

Browse files
committed
Remove Test::Builder::IO::Scalar
Fixes #1016
1 parent b1a05c4 commit 0eda12c

File tree

5 files changed

+11
-703
lines changed

5 files changed

+11
-703
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
{{$NEXT}}
88

9+
- Remove Test::Builder::IO::Scalar
10+
- Fix #1016
11+
912
1.302205 2024-12-19 09:28:05-08:00 America/Los_Angeles
1013

1114
- Use our instead of 'use vars'

lib/Test/Builder.pm

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ use warnings;
66

77
our $VERSION = '1.302206';
88

9-
BEGIN {
10-
if( $] < 5.008 ) {
11-
require Test::Builder::IO::Scalar;
12-
}
13-
}
14-
159
use Scalar::Util qw/blessed reftype weaken/;
1610

1711
use Test2::Util qw/USE_THREADS try get_tid/;
@@ -1366,27 +1360,19 @@ sub todo_output {
13661360

13671361
sub _new_fh {
13681362
my $self = shift;
1369-
my($file_or_fh) = shift;
1363+
my ($file_or_fh) = shift;
13701364

13711365
my $fh;
1372-
if( $self->is_fh($file_or_fh) ) {
1366+
if ($self->is_fh($file_or_fh)) {
13731367
$fh = $file_or_fh;
13741368
}
1375-
elsif( ref $file_or_fh eq 'SCALAR' ) {
1376-
# Scalar refs as filehandles was added in 5.8.
1377-
if( $] >= 5.008 ) {
1378-
open $fh, ">>", $file_or_fh
1379-
or $self->croak("Can't open scalar ref $file_or_fh: $!");
1380-
}
1381-
# Emulate scalar ref filehandles with a tie.
1382-
else {
1383-
$fh = Test::Builder::IO::Scalar->new($file_or_fh)
1384-
or $self->croak("Can't tie scalar ref $file_or_fh");
1385-
}
1369+
elsif (ref $file_or_fh eq 'SCALAR') {
1370+
open $fh, ">>", $file_or_fh
1371+
or $self->croak("Can't open scalar ref $file_or_fh: $!");
13861372
}
13871373
else {
13881374
open $fh, ">", $file_or_fh
1389-
or $self->croak("Can't open test output log $file_or_fh: $!");
1375+
or $self->croak("Can't open test output log $file_or_fh: $!");
13901376
_autoflush($fh);
13911377
}
13921378

0 commit comments

Comments
 (0)