This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/op/local.t: tests for RT #7615
[perl5.git] / t / op / print.t
CommitLineData
a9bec287
GG
1#!./perl
2
3BEGIN {
b5efbd1f 4 chdir 't' if -d 't';
1ae3d757 5 require "./test.pl";
a9bec287
GG
6}
7
0ae1fa71 8plan(3);
a9bec287 9
de482fd5 10fresh_perl_is('$_ = qq{OK\n}; print;', "OK\n", {},
a9bec287 11 'print without arguments outputs $_');
de482fd5 12fresh_perl_is('$_ = qq{OK\n}; print STDOUT;', "OK\n", {},
a9bec287 13 'print with only a filehandle outputs $_');
0ae1fa71
CH
14SKIP: {
15 skip_if_miniperl('no dynamic loading of PerlIO::scalar in miniperl');
9ab822f7 16 skip("overlong UTF-8 test is ASCII-centric") if $::IS_EBCDIC; # Varies depending on code page
20e5bab4 17fresh_perl_is(<<'EOF', "\xC1\xAF\xC1\xAF\xC1\xB0\xC1\xB3", {}, "print doesn't launder utf8 overlongs");
0ae1fa71
CH
18use strict;
19use warnings;
20
21no warnings 'utf8';
22
23# These form overlong "oops"
24open my $fh, "<:utf8", \"\xC1\xAF\xC1\xAF\xC1\xB0\xC1\xB3"
25 or die "Could not open\n";
26read($fh, my $s, 10) or die "Could not read\n";
27print $s;
28EOF
29
30}