develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33665 - branches/pdd22io_part2/t/pmc

From:
allison
Date:
December 8, 2008 11:50
Subject:
[svn:parrot] r33665 - branches/pdd22io_part2/t/pmc
Message ID:
20081208194953.A9332CB9AF@x12.develooper.com
Author: allison
Date: Mon Dec  8 11:49:52 2008
New Revision: 33665

Modified:
   branches/pdd22io_part2/t/pmc/filehandle.t

Log:
[pdd22io] Tests for encoding on 'readall'.


Modified: branches/pdd22io_part2/t/pmc/filehandle.t
==============================================================================
--- branches/pdd22io_part2/t/pmc/filehandle.t	(original)
+++ branches/pdd22io_part2/t/pmc/filehandle.t	Mon Dec  8 11:49:52 2008
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 15;
+use Parrot::Test tests => 17;
 use Parrot::Test::Util 'create_tempfile';
 
 =head1 NAME
@@ -546,6 +546,41 @@
 ok
 OUTPUT
 
+pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on closed filehandle" );
+.sub 'main'
+    .local pmc ifh
+    ifh = new 'FileHandle'
+    ifh.'encoding'('utf8')
+   
+    \$S0 = ifh.'readall'('$temp_file')
+
+    \$I0 = encoding \$S0
+    \$S1 = encodingname \$I0
+
+    say \$S1
+.end
+CODE
+utf8
+OUTPUT
+
+pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on opened filehandle" );
+.sub 'main'
+    .local pmc ifh
+    ifh = new 'FileHandle'
+    ifh.'encoding'('utf8')
+    ifh.'open'('$temp_file')
+
+    \$S0 = ifh.'readall'()
+
+    \$I0 = encoding \$S0
+    \$S1 = encodingname \$I0
+
+    say \$S1
+.end
+CODE
+utf8
+OUTPUT
+
 # RT #46843
 # L<PDD22/I\/O PMC API/=item get_fd>
 # NOTES: this is going to be platform dependent



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About