New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO.get should always return a Str (or Buf) #969
Comments
From @moritzCurrently IO.get still does the old magic that prefix:<=> needed, which That must go away, and always return a Str. For example $*IN.get.int should work, but does not currently: Cheers, |
From @jnthnOn Sun May 03 14:40:32 2009, moritz wrote:
It seems that this now works as it should.
Assigning to moritz++ for spectests. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S16-filehandles/io.t commit 6d8fde79ae58c5a4e247771409d83fff3435d072 [t/spec] Test for RT #65348 Inline Patchdiff --git a/t/spec/S16-filehandles/io.t b/t/spec/S16-filehandles/io.t
index 427b4e8..a42ec12 100644
--- a/t/spec/S16-filehandles/io.t
+++ b/t/spec/S16-filehandles/io.t
@@ -13,7 +13,7 @@ I/O tests
=end pod
-plan 62;
+plan *;
#?pugs emit if $*OS eq "browser" {
#?pugs emit skip_rest "Programs running in browsers don't have access to regular IO.";
@@ -164,8 +164,28 @@ ok($fh9.close, 'file closed okay (9)');
#ok($fh10.close, 'file closed okay (10)');
}
+# RT #65348
+{
+ my $rt65348_out = open($filename, :w);
+ isa_ok $rt65348_out, IO;
+ $rt65348_out.say( 'RT #65348' );
+ $rt65348_out.say( '13.37' );
+ $rt65348_out.say( '42.17' );
+ ok $rt65348_out.close, 'close worked (rt65348 out)';
+
+ my $rt65348_in = open( $filename );
+ isa_ok $rt65348_in, IO;
+ my @list_context = ($rt65348_in.get);
+ is +@list_context, 1, '.get in list context reads only one line';
+ ok $rt65348_in.get.Int ~~ Int, '.get.Int gets int';
+ is $rt65348_in.get.Int, 42, '.get.Int gets the right int';
+ ok $rt65348_in.close, 'close worked (rt65348 in)';
+}
+
#?pugs todo 'buggy on Win32'
ok(unlink($filename), 'file has been removed');
ok $filename !~~ :e, '... and the tempfile is gone, really';
+done_testing;
+
# vim: ft=perl6 |
From @kylehaTests for this are written and passing, so I'm marking this resolved. |
@kyleha - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#65348 (status was 'resolved')
Searchable as RT65348$
The text was updated successfully, but these errors were encountered: