Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / op / magic.t
index 4f38623..ede0b8b 100755 (executable)
@@ -134,9 +134,9 @@ ok((keys %h)[0] eq "foo\034bar", (keys %h)[0]);
 }
 
 # $?, $@, $$
-system qq[$PERL -e "exit(0)"];
+system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(0)"];
 ok $? == 0, $?;
-system qq[$PERL -e "exit(1)"];
+system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(1)"];
 ok $? != 0, $?;
 
 eval { die "foo\n" };
@@ -250,13 +250,12 @@ else {
                            : (`echo \$__NoNeSuCh` eq "foo\n") );
 }
 
-if ($Is_VMS) {
-    ok(1,0,"'\$!=undef' does throw a warning");
-}
-else {
-    local $SIG{'__WARN__'} = sub { print "# @_\nnot " };
+{
+    my $ok = 1;
+    my $warn = '';
+    local $SIG{'__WARN__'} = sub { $ok = 0; $warn = join '', @_; };
     $! = undef;
-    ok 1;
+    ok($ok, $warn, $Is_VMS ? "'\$!=undef' does throw a warning" : '');
 }
 
 # test case-insignificance of %ENV (these tests must be enabled only