diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-02-17 14:59:39 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-02-18 21:32:42 -0700 |
commit | 62ba9123033beb0f19ee9d28c9d1cc6b3bf57e46 (patch) | |
tree | d31ee67e1c37b35c25de57c0b51d43701ae450ae /dist | |
parent | 10e621bc35cb48b15b69b5a57242ff004f7455dc (diff) | |
download | perl-62ba9123033beb0f19ee9d28c9d1cc6b3bf57e46.tar.gz |
Tests for [perl #116322]
Diffstat (limited to 'dist')
-rw-r--r-- | dist/IO/t/io_utf8.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dist/IO/t/io_utf8.t b/dist/IO/t/io_utf8.t index 53c209d4b8..339e278e2c 100644 --- a/dist/IO/t/io_utf8.t +++ b/dist/IO/t/io_utf8.t @@ -9,7 +9,9 @@ BEGIN { require($ENV{PERL_CORE} ? "../../t/test.pl" : "./t/test.pl"); -plan(tests => 5); +my $buf_size_count = 8200; # Above default buffer size of 8192 + +plan(tests => 5 + 2 * $buf_size_count); my $io; @@ -24,6 +26,15 @@ undef $io; $io = IO::File->new; ok($io->open("io_utf8", "<:utf8"), "open <:utf8"); is(ord(<$io>), 256, "readline chr(256)"); + +for my $i (0 .. $buf_size_count - 1) { + is($io->ungetc($i), $i, "ungetc of $i returns itself"); +} + +for (my $i = $buf_size_count - 1; $i >= 0; $i--) { + is(ord($io->getc()), $i, "getc gets back $i"); +} + undef $io; END { |