This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[patch] for Stratus VOS
[perl5.git] / t / op / readline.t
CommitLineData
79628082
SM
1#!./perl
2
3BEGIN {
4 chdir 't';
5 @INC = '../lib';
6 require './test.pl';
7}
8
10bcdfd6 9plan tests => 5;
79628082
SM
10
11eval { for (\2) { $_ = <FH> } };
12like($@, 'Modification of a read-only value attempted', '[perl #19566]');
13
ba92458f
AE
14{
15 open A,"+>a"; $a = 3;
16 is($a .= <A>, 3, '#21628 - $a .= <A> , A eof');
17 close A; $a = 4;
18 is($a .= <A>, 4, '#21628 - $a .= <A> , A closed');
19 unlink "a";
20}
10bcdfd6
NC
21
22# 82 is chosen to exceed the length for sv_grow in do_readline (80)
23foreach my $k ('k', 'k'x82) {
24 my $result
25 = runperl (switches => '-l', stdin => '', stderr => 1,
26 prog => "%a = qw($k v); \$_ = <> foreach keys %a; print qw(end)",
27 );
28 is ($result, "end", '[perl #21614] for length ' . length $k);
29}