I have this commit pushed to a smoke-me branch. It doesn't cause any test
failures on the HP VMS testdrive system. Am I making bad assumptions?

Specifically, is it filesystem dependant whether this code as-is will pass?

    open(H,'run/fresh_perl.t'); # must be in the 't' directory
    stat(H);
    print "ok\n" if (-e _ and -f _ and -r _);

I infer that it must have failed 12 years ago, because the last line was
"corrected" to

    print "ok\n" if (-e _ and -f _);


But what changed to cause it to work now?


Nicholas Clark


commit 219b23a016e4d19b9fc29d2cb6aad7c8f485e7bc
Author: Nicholas Clark <n...@ccl4.org>
Date:   Wed Aug 7 11:57:09 2013 +0200

    Remove the two "VMS adjustments" from test.pl's _fresh_perl
    
    These were added by commit ed6b3797850720f7 ("make t/op/misc.t work on VMS")
    in Jan 2001 back when the relevant code was in t/op/misc.t
    
    The two adjustments each only applied to one test.
    
    Was:    system './perl -ne "print if eof" /dev/null'
    Became: system './perl -ne "print if eof" NL:'
    
    Was:    print "ok\n" if (-e _ and -f _ and -r _);
    Became: print "ok\n" if (-e _ and -f _);
    
    The latter had the comment "VMS file locking".
    
    It seems that neither is needed now. Perl will recognise "/dev/null" as
    the null device, and -r returns true on a file opened for reading.
    
    The "adjustments", particularly the second, should have been done all along
    in the code for the test itself, not by complicating the test runner.

diff --git a/t/test.pl b/t/test.pl
index 89c1d4d..3662aa6 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -848,16 +848,6 @@ sub _fresh_perl {
     $runperl_args->{stderr}     = 1 unless exists $runperl_args->{stderr};
 
     open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!";
-
-    # VMS adjustments
-    if( $is_vms ) {
-        $prog =~ s#/dev/null#NL:#;
-
-        # VMS file locking
-        $prog =~ s{if \(-e _ and -f _ and -r _\)}
-                  {if (-e _ and -f _)}
-    }
-
     print TEST $prog;
     close TEST or die "Cannot close $tmpfile: $!";
 

Reply via email to