andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:
$ cat test_exit.pl use strict; use warnings; sub killer { die "hasta la vista baby"; } sub exiter { exit(42); } 1; __END__
$ cat test_exit.t use warnings; use strict; use Test::More tests => 2; use Test::Exception; ok(require('test_exit.pl'), 'loaded'); throws_ok( sub { killer () }, qr/hasta la vista baby/, q{Expected kill +er to die}); __END__
Now I wonder what kind of tricks I can use to test exit in the same way as die?$ prove test_exit.t test_exit....ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.04 cusr + 0.01 csys = 0.05 C +PU)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to test exit?
by Sidhekin (Priest) on Jun 05, 2007 at 21:22 UTC | |
Re: How to test exit?
by Fletch (Bishop) on Jun 05, 2007 at 19:14 UTC | |
by Trizor (Pilgrim) on Jun 05, 2007 at 20:40 UTC | |
Re: How to test exit?
by Roy Johnson (Monsignor) on Jun 05, 2007 at 19:23 UTC | |
Re: How to test exit? - override CORE::GLOBAL::exit
by imp (Priest) on Jun 05, 2007 at 19:46 UTC | |
by imp (Priest) on Jun 05, 2007 at 20:16 UTC | |
by Anonymous Monk on Oct 31, 2014 at 08:44 UTC | |
Re: How to test exit?
by FunkyMonk (Chancellor) on Jun 05, 2007 at 19:25 UTC |