Skip to content

Commit 2767506

Browse files
committed
Use __FILE__ instead of $^X in test
For some reason, opening `$^X` failed for someone. See GH #25.
1 parent d55ffc7 commit 2767506

File tree

11 files changed

+23
-11
lines changed

11 files changed

+23
-11
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{{$NEXT}}
22

3+
- Fixed a test failure when trying to open $^X on some platforms.
4+
5+
36
0.52 2025-08-09
47

58
- Really made it possible to force Specio to use only pure Perl dependencies. The changes in 0.51

lib/Test/Specio.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,5 +1516,5 @@ If you want to create a glob overloading object that returns a filehandle, do
15161516
this:
15171517
15181518
local *BAR;
1519-
open BAR, '<', $^X or die "Could not open $^X for the test";
1520-
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
1519+
my $file = __FILE__;
1520+
open BAR, '<', $file or die "Could not open $file for the test";

t/builtins-sanity.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
2020

2121
local *BAR;
2222
{
23+
my $file = __FILE__;
2324
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
24-
open BAR, '<', $^X or die "Could not open $^X for the test";
25+
open BAR, '<', $file or die "Could not open $file for the test";
2526
}
2627
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
2728

t/declare-helpers.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
2222

2323
local *BAR;
2424
{
25+
my $file = __FILE__;
2526
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
26-
open BAR, '<', $^X or die "Could not open $^X for the test";
27+
open BAR, '<', $file or die "Could not open $file for the test";
2728
}
2829
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
2930

t/dict.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
7575

7676
local *BAR;
7777
{
78+
my $file = __FILE__;
7879
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
79-
open BAR, '<', $^X or die "Could not open $^X for the test";
80+
open BAR, '<', $file or die "Could not open $file for the test";
8081
}
8182
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
8283

t/intersection.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
5050

5151
local *BAR;
5252
{
53+
my $file = __FILE__;
5354
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
54-
open BAR, '<', $^X or die "Could not open $^X for the test";
55+
open BAR, '<', $file or die "Could not open $file for the test";
5556
}
5657
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
5758

t/map.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
4545

4646
local *BAR;
4747
{
48+
my $file = __FILE__;
4849
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
49-
open BAR, '<', $^X or die "Could not open $^X for the test";
50+
open BAR, '<', $file or die "Could not open $file for the test";
5051
}
5152
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
5253

t/string-sanity.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
3535

3636
local *BAR;
3737
{
38+
my $file = __FILE__;
3839
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
39-
open BAR, '<', $^X or die "Could not open $^X for the test";
40+
open BAR, '<', $file or die "Could not open $file for the test";
4041
}
4142
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
4243

t/subs.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
4040

4141
local *BAR;
4242
{
43+
my $file = __FILE__;
4344
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
44-
open BAR, '<', $^X or die "Could not open $^X for the test";
45+
open BAR, '<', $file or die "Could not open $file for the test";
4546
}
4647
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
4748

t/tuple.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO );
8282

8383
local *BAR;
8484
{
85+
my $file = __FILE__;
8586
## no critic (InputOutput::ProhibitBarewordFileHandles, InputOutput::RequireBriefOpen)
86-
open BAR, '<', $^X or die "Could not open $^X for the test";
87+
open BAR, '<', $file or die "Could not open $file for the test";
8788
}
8889
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR );
8990

0 commit comments

Comments
 (0)