Get coreamp.t passing on VMS.
authorCraig A. Berry <craigberry@mac.com>
Sat, 27 Aug 2011 22:26:25 +0000 (17:26 -0500)
committerCraig A. Berry <craigberry@mac.com>
Sat, 27 Aug 2011 22:26:25 +0000 (17:26 -0500)
The last record in a file ends with a newline willy nilly, so we
might as well write (and test for) one explicitly.

The name of a directory file ends with .DIR, so we need to allow
for that.

File::Temp panics when trying to delete the directory that is the
current working directory, so save where we were and restore to it
before clean-up.

t/op/coreamp.t

index ef6db63..37802bd 100644 (file)
@@ -378,7 +378,7 @@ test_proto $_ for qw(
 
 test_proto 'exit';
 $tests ++;
-is runperl(prog => '&CORE::exit; END { print q-ok- }'), 'ok',
+is runperl(prog => '&CORE::exit; END { print qq-ok\n- }'), "ok\n",
   '&exit with no args';
 
 test_proto 'fork';
@@ -724,13 +724,17 @@ test_proto 'warn';
 
 {
   last if is_miniperl;
+  require Cwd;
+  import Cwd;
   $tests += 2;
   require File::Temp ;
   my $dir = File::Temp::tempdir(uc cleanup => 1);
+  my $cwd = cwd();
   chdir($dir);
   my $_ = 'Phoo';
   ok &mymkdir(), '&mkdir';
-  like <*>, qr/^phoo\z/i, 'mkdir works with implicit $_';
+  like <*>, qr/^phoo(.DIR)?\z/i, 'mkdir works with implicit $_';
+  chdir($cwd); # so auto-cleanup can remove $dir
 }
 
 # ------------ END TESTING ----------- #