Move podlators from lib to ext.
[p5sagit/p5-mst-13.2.git] / lib / Pod / t / Usage.t
index 4afbe5d..2cabb55 100644 (file)
@@ -36,7 +36,7 @@ SKIP: {
         pod2usage({ -verbose => 0, -exit => 'noexit', 
                     -output => \*FAKEOUT, -input => $file });
     };
-    like( $@, qr/^Can't open $file for reading:/, 
+    like( $@, qr/^Can't open $file/, 
           'File not found without -pathlist' );
 
     eval {
@@ -47,17 +47,25 @@ SKIP: {
     is( $$fake_out, $vbl_0, '-pathlist parameter' );
 }
 
-{ # Test exit status from pod2usage()
-    my $exit = 42;
+SKIP: { # Test exit status from pod2usage()
+    skip "Exit status broken on Mac OS", 1 if $^O eq 'MacOS';
+    my $exit = ($^O eq 'VMS' ? 2 : 42);
     my $dev_null = File::Spec->devnull;
     my $args = join ", ", (
         "-verbose => 0", 
         "-exit    => $exit",
-        "-output  => q[$dev_null]",
-        "-input   => q[$0]",
+        "-output  => q{$dev_null}",
+        "-input   => q{$0}",
     );
-    my $prg = qq[pod2usage({ $args })];
-    my @cmd = ( $^X, '-I../lib',  '-MPod::Usage', '-e',  $prg );
+    my $cq = (($^O eq 'MSWin32'
+               || $^O eq 'NetWare'
+               || $^O eq 'VMS') ? '"'
+              : "");
+    my @params = ( "${cq}-I../lib$cq",  "${cq}-MPod::Usage$cq", '-e' );
+    my $prg = qq[${cq}pod2usage({ $args })$cq];
+    my @cmd = ( $^X, @params, $prg );
+
+    print "# cmd = @cmd\n";
 
     is( system( @cmd ) >> 8, $exit, 'Exit status of pod2usage()' );
 }