summaryrefslogtreecommitdiff
path: root/dist/IO/t/io_utf8.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-28 14:58:16 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-29 11:12:37 +0100
commit725607636edc598ad6823e49789420d734f8aa28 (patch)
tree2e6a93cdd6c65e8412bf874507a63c8ac8f14a71 /dist/IO/t/io_utf8.t
parent8b2306352e674fdd7eb8b61ff2ce78864a87ed9c (diff)
downloadperl-725607636edc598ad6823e49789420d734f8aa28.tar.gz
Move IO from ext/ to dist/
Diffstat (limited to 'dist/IO/t/io_utf8.t')
-rw-r--r--dist/IO/t/io_utf8.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/dist/IO/t/io_utf8.t b/dist/IO/t/io_utf8.t
new file mode 100644
index 0000000000..53c209d4b8
--- /dev/null
+++ b/dist/IO/t/io_utf8.t
@@ -0,0 +1,31 @@
+#!./perl
+
+BEGIN {
+ unless ($] >= 5.008 and find PerlIO::Layer 'perlio') {
+ print "1..0 # Skip: not perlio\n";
+ exit 0;
+ }
+}
+
+require($ENV{PERL_CORE} ? "../../t/test.pl" : "./t/test.pl");
+
+plan(tests => 5);
+
+my $io;
+
+use_ok('IO::File');
+
+$io = IO::File->new;
+
+ok($io->open("io_utf8", ">:utf8"), "open >:utf8");
+ok((print $io chr(256)), "print chr(256)");
+undef $io;
+
+$io = IO::File->new;
+ok($io->open("io_utf8", "<:utf8"), "open <:utf8");
+is(ord(<$io>), 256, "readline chr(256)");
+undef $io;
+
+END {
+ 1 while unlink "io_utf8";
+}