Skip to content

Commit 0eceef0

Browse files
1-1samkhwilliamson
authored andcommitted
todo test for GH 1420 (*FH{IO} and $. scoping ickiness)
This commit adds a todo test for GH 1420 that tests that $. reports the correct line number when reading from a file handle assigned from an IO reference instead of a glob.
1 parent 0c9e962 commit 0eceef0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

t/run/todo.t

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,29 @@ my $is_debugging_build = $Config{cppflags} =~ /-DDEBUGGING/;
107107

108108
our $TODO;
109109

110+
TODO: {
111+
local $::TODO = 'GH 1420';
112+
113+
my $data = <<~"HERE";
114+
AMAZING BUT TRUE ...
115+
116+
There is so much sand in Northern Africa that if it were spread out it
117+
would completely cover the Sahara Desert.
118+
HERE
119+
120+
my $fh = do {
121+
local *FH;
122+
open(FH, '<', \$data);
123+
*FH{IO};
124+
};
125+
0 while <$fh>;
126+
my $lc = $.;
127+
close($fh);
128+
129+
is($lc, 4, 'Correct line count reported from $. when reading from *FH{IO}; GH 1420');
130+
131+
}
132+
110133
TODO: {
111134
local $::TODO = 'GH 5835';
112135
my $prev_w = $^W;

0 commit comments

Comments
 (0)