6 unless (find PerlIO::Layer 'perlio') {
7 print "1..0 # Skip: not perlio\n";
10 if ($ENV{PERL_CORE_MINITEST}) {
11 print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
14 require Config; import Config;
15 if ($Config{'extensions'} !~ /\bEncode\b/) {
16 print "1..0 # Skip: Encode was not built\n";
21 BEGIN { require "./test.pl"; }
25 my $BOM = chr(0xFEFF);
28 my ($enc, $tag, $bom) = @_;
29 open(UTF_PL, ">:raw:encoding($enc)", "utf.pl")
30 or die "utf.pl($enc,$tag,$bom): $!";
31 print UTF_PL $BOM if $bom;
32 print UTF_PL "$tag\n";
34 my $got = do "./utf.pl";
38 test("utf16le", 123, 1);
39 test("utf16le", 1234, 1);
40 test("utf16le", 12345, 1);
41 test("utf16be", 123, 1);
42 test("utf16be", 1234, 1);
43 test("utf16be", 12345, 1);
45 test("utf8", 1234, 1);
46 test("utf8", 12345, 1);
48 test("utf16le", 123, 0);
49 test("utf16le", 1234, 0);
50 test("utf16le", 12345, 0);
51 test("utf16be", 123, 0);
52 test("utf16be", 1234, 0);
53 test("utf16be", 12345, 0);
56 1 while unlink "utf.pl";