Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / utf8.t
CommitLineData
04955c14 1#!/usr/bin/perl -w
ccbd73a4 2# $Id: /mirror/googlecode/test-more/t/utf8.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
04955c14 3
4BEGIN {
5 if( $ENV{PERL_CORE} ) {
6 chdir 't';
7 @INC = '../lib';
8 }
9}
10
11use strict;
12use warnings;
13
bdff39c7 14use Test::More skip_all => 'Not yet implemented';
04955c14 15
16my $have_perlio;
17BEGIN {
18 # All together so Test::More sees the open discipline
19 $have_perlio = eval q[
20 use PerlIO;
21 use open ':std', ':locale';
22 use Test::More;
23 1;
24 ];
25}
bdff39c7 26
27use Test::More;
28
29if( !$have_perlio ) {
30 plan skip_all => "Don't have PerlIO";
31}
32else {
33 plan tests => 5;
34}
04955c14 35
36SKIP: {
37 skip( "Need PerlIO for this feature", 3 )
38 unless $have_perlio;
39
40 my %handles = (
41 output => \*STDOUT,
42 failure_output => \*STDERR,
43 todo_output => \*STDOUT
44 );
45
46 for my $method (keys %handles) {
47 my $src = $handles{$method};
48
49 my $dest = Test::More->builder->$method;
50
bdff39c7 51 is_deeply { map { $_ => 1 } PerlIO::get_layers($dest) },
52 { map { $_ => 1 } PerlIO::get_layers($src) },
04955c14 53 "layers copied to $method";
54 }
55}
56
57SKIP: {
58 skip( "Can't test in general because their locale is unknown", 2 )
59 unless $ENV{AUTHOR_TESTING};
60
61 my $uni = "\x{11e}";
62
63 my @warnings;
64 local $SIG{__WARN__} = sub {
65 push @warnings, @_;
66 };
67
68 is( $uni, $uni, "Testing $uni" );
69 is_deeply( \@warnings, [] );
bdff39c7 70}