Commit | Line | Data |
---|---|---|
a9bec287 GG |
1 | #!./perl |
2 | ||
3 | BEGIN { | |
4 | require "test.pl"; | |
5 | } | |
6 | ||
0ae1fa71 | 7 | plan(3); |
a9bec287 GG |
8 | |
9 | fresh_perl_is('$_ = qq{OK\n}; print;', "OK\n", | |
10 | 'print without arguments outputs $_'); | |
11 | fresh_perl_is('$_ = qq{OK\n}; print STDOUT;', "OK\n", | |
12 | 'print with only a filehandle outputs $_'); | |
0ae1fa71 CH |
13 | SKIP: { |
14 | skip_if_miniperl('no dynamic loading of PerlIO::scalar in miniperl'); | |
15 | fresh_perl_is(<<'EOF', "\xC1\xAF\xC1\xAF\xC1\xB0\xC1\xB3", "", "print doesn't launder utf8 overlongs"); | |
16 | use strict; | |
17 | use warnings; | |
18 | ||
19 | no warnings 'utf8'; | |
20 | ||
21 | # These form overlong "oops" | |
22 | open my $fh, "<:utf8", \"\xC1\xAF\xC1\xAF\xC1\xB0\xC1\xB3" | |
23 | or die "Could not open\n"; | |
24 | read($fh, my $s, 10) or die "Could not read\n"; | |
25 | print $s; | |
26 | EOF | |
27 | ||
28 | } |