File: bug.t

package info (click to toggle)
libperlio-utf8-strict-perl 0.010-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 724 kB
  • sloc: perl: 278; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! perl

use strict;
use warnings;
use utf8;

use Test::More 0.88;
use Test::Exception;
use IO::Handle;
use lib 't/lib';
use Util qw[fh_with_octets slurp];


my $fh = fh_with_octets("\xE2\x98\xBA" x 8092);

lives_ok { 
    my $data = do { local $/; <$fh> } 
} q[successfull reading 8092 WHITE SMILING FACE's];

{
    my $line = 'ascii';
    my ( $in, $out );
    pipe $in, $out;
    binmode $out, ':utf8_strict';
    binmode $in,  ':utf8_strict';
    print $out "...\n";
    $out->flush;
    $line .= readline $in;

    is($line, "ascii...\n", 'Appending from utf8 to ascii');
}


done_testing;