[ANNOUNCE] Test::Simple 0.47
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / exit.t
index 1367bbf..0ba76ba 100644 (file)
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+
 # Can't use Test.pm, that's a 5.005 thing.
 package My::Test;
 
@@ -53,6 +55,7 @@ my %Tests = (
              'too_few.plx'              => [4,      4],
              'death.plx'                => [255,    4],
              'last_minute_death.plx'    => [255,    4],
+             'pre_plan_death.plx'       => ['not zero',    'not zero'],
              'death_in_eval.plx'        => [0,      0],
              'require.plx'              => [0,      0],
             );
@@ -87,6 +90,14 @@ while( my($test_name, $exit_codes) = each %Tests ) {
     my $wait_stat = system(qq{$Perl -"I../blib/lib" -"I../lib" -"I../t/lib" $file});
     my $actual_exit = exitstatus($wait_stat);
 
-    My::Test::ok( $actual_exit == $exit_code, 
-                  "$test_name exited with $actual_exit (expected $exit_code)");
+    if( $exit_code eq 'not zero' ) {
+        My::Test::ok( $actual_exit != 0,
+                      "$test_name exited with $actual_exit ".
+                      "(expected $exit_code)");
+    }
+    else {
+        My::Test::ok( $actual_exit == $exit_code, 
+                      "$test_name exited with $actual_exit ".
+                      "(expected $exit_code)");
+    }
 }