File: encoding.t

package info (click to toggle)
libio-all-perl 0.39-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 536 kB
  • ctags: 331
  • sloc: perl: 2,761; makefile: 5
file content (43 lines) | stat: -rw-r--r-- 823 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
use lib 't', 'lib';
use strict;
use warnings;
use Test::More;
use IO_All_Test;

BEGIN {
    plan(($] < 5.008003)
          ? (skip_all => 'Broken on older perls')
          : (tests => 4)
    );
}

package Normal;

use IO::All;

package UTF8;

use IO::All -utf8;

package Big5;

use IO::All -encoding => 'big5';

package main;

isnt Normal::io('t/text.big5')->all,
     Normal::io('t/text.utf8')->all,
     'big5 and utf8 tests are different';

isnt Normal::io('t/text.big5')->all,
     Big5::io('t/text.big5')->all,
     'Read big5 with different io-s does not match';

is UTF8::io('t/text.utf8')->all,
   Big5::io('t/text.big5')->all,
   'Big5 text matches utf8 text after read';

is Normal::io('t/text.utf8')->utf8->all,
   Normal::io('t/text.big5')->encoding('big5')->all,
   'Big5 text matches utf8 text after read';