This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make newline on last record explicit.
authorCraig A. Berry <craigberry@mac.com>
Thu, 6 Jan 2011 01:14:06 +0000 (19:14 -0600)
committerCraig A. Berry <craigberry@mac.com>
Thu, 6 Jan 2011 04:00:29 +0000 (22:00 -0600)
On VMS, the last line written to a file will get a trailing newline
willy nilly.  This has its advantages insofar as you never get the
"no newline at end of file" warnings from various utilities, but
reality conflicts with expectations when you explicitly test for
the last (or only) line *not* ending with newline, which is what
the recent addtion to ref.t (5e3072707906cc4cb8a364c4cf7c487df0300caa)
was doing.  Adding an explicit newline makes everyone happy.

t/op/ref.t

index 83b5cb8..0a39f10 100644 (file)
@@ -381,16 +381,16 @@ curr_test($test + 2);
 
 is(
   runperl(
-   stderr => 1, prog => 'sub DESTROY { print q-aaa- } bless \$a[0]'
+   stderr => 1, prog => 'sub DESTROY { print qq-aaa\n- } bless \$a[0]'
   ),
- "aaa", 'DESTROY called on array elem'
+ "aaa\n", 'DESTROY called on array elem'
 );
 is(
   runperl(
    stderr => 1,
-   prog => '{ bless \my@x; *a=sub{@x}}sub DESTROY { print q-aaa- }'
+   prog => '{ bless \my@x; *a=sub{@x}}sub DESTROY { print qq-aaa\n- }'
   ),
- "aaa",
+ "aaa\n",
  'DESTROY called on closure variable'
 );