File: unicode.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 (25 lines) | stat: -rw-r--r-- 474 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
#! perl

use strict;
use warnings;
use utf8;

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

for (my $cp = 0x00; $cp < 0x10FFFF; $cp += 0x1000) {
    my $octets = pack_utf8($cp);
    my $name   = sprintf 'successfull reading U+%.4X <%s>',
      $cp, join ' ', map { sprintf '%.2X', ord $_ } split //, $octets;

    my $fh = fh_with_octets($octets);

    lives_ok {
        slurp($fh);
    } $name;
}

done_testing;