Skip to content

Commit 859ce43

Browse files
committed
Test that two invocations of lines() doesn't touch $*IN
RT #125380
1 parent 30101e3 commit 859ce43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

S16-filehandles/argfiles.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test;
44
use lib 't/spec/packages';
55
use Test::Util;
66

7-
plan 7;
7+
plan 8;
88

99
sub create-temporary-file {
1010
my $filename = $*TMPDIR ~ '/tmp.' ~ $*PID ~ '-' ~ time;
@@ -56,4 +56,10 @@ $output = Test::Util::run('.say for lines()', "foo\nbar\nbaz\n", :@args);
5656

5757
is-deeply @lines, [<one two three>], '$*ARGFILES should not use $*IN if files are in @*ARGS';
5858

59+
$output = Test::Util::run('.say for lines(); .say for lines()', "foo\nbar\nbaz\n", :@args);
60+
@lines = lines($output);
61+
62+
# RT #125380
63+
is-deeply @lines, [<one two three>], 'Calling lines() twice should not read from $*IN';
64+
5965
$tmp-file-name.IO.unlink;

0 commit comments

Comments
 (0)