Re: [PATCH] xsubpp prototypes warnings
[p5sagit/p5-mst-13.2.git] / t / test.pl
index a00dd5e..351963a 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -77,6 +77,7 @@ sub _where {
     return "at $caller[1] line $caller[2]";
 }
 
+# DON'T use this for matches. Use like() instead.
 sub ok {
     my ($pass, $name, @mess) = @_;
     _ok($pass, _where(), $name, @mess);
@@ -271,7 +272,7 @@ sub _quote_args {
     foreach (@$args) {
        # In VMS protect with doublequotes because otherwise
        # DCL will lowercase -- unless already doublequoted.
-       $_ = q(").$_.q(") if $is_vms && !/^\"/;
+       $_ = q(").$_.q(") if $is_vms && !/^\"/ && length($_) > 0;
        $$runperl .= ' ' . $_;
     }
 }
@@ -453,7 +454,11 @@ sub _fresh_perl {
         print STDERR "# STATUS: $status\n";
     }
 
-    ($name) = $prog =~ /^(.{1,35})/ unless $name;
+    # Use the first line of the program as a name if none was given
+    unless( $name ) {
+        ($first_line, $name) = $prog =~ /^((.{1,50}).*)/;
+        $name .= '...' if length $first_line > length $name;
+    }
 
     _ok($pass, _where(), "fresh_perl - $name");
 }