Permalink
Browse files

$fh.lines if the file has no trailing newline (RT #112130)

  • Loading branch information...
1 parent 91d1b92 commit 1fa3c3797ffd8c9185e1bfba131c3daeba567212 @moritz moritz committed Mar 30, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 S16-filehandles/io.t
View
13 S16-filehandles/io.t
@@ -13,7 +13,7 @@ I/O tests
=end pod
-plan 83;
+plan 84;
#?pugs emit if $*OS eq "browser" {
#?pugs emit skip_rest "Programs running in browsers don't have access to regular IO.";
@@ -258,6 +258,17 @@ $out.close;
}
unlink($filename);
+# RT #112130
+{
+ $out = open($filename, :w);
+ $out.print('blarg');
+ $out.close;
+ my $in = open($filename);
+ is $in.lines.join, 'blarg', 'can use .lines on a file without trailing newline';
+ $in.close;
+ unlink $filename;
+}
+
done;
# vim: ft=perl6

0 comments on commit 1fa3c37

Please sign in to comment.