ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Guard/t/03_die.t
Revision: 1.1
Committed: Sat Dec 13 17:37:22 2008 UTC (15 years, 5 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-0_1
Log Message:
initial check-in

File Contents

# User Rev Content
1 root 1.1 BEGIN { $| = 1; print "1..7\n"; }
2    
3     use Guard;
4    
5     print "ok 1\n";
6    
7     $Guard::DIED = sub {
8     print $@ =~ /^x1 at / ? "" : "not ", "ok 3 # $@\n";
9     };
10    
11     eval {
12     scope_guard { die "x1" };
13     print "ok 2\n";
14     };
15    
16     print $@ ? "not " : "", "ok 4 # $@\n";
17    
18     $Guard::DIED = sub {
19     print $@ =~ /^x2 at / ? "" : "not ", "ok 6 # $@\n";
20     };
21    
22     eval {
23     scope_guard { die "x2" };
24     print "ok 5\n";
25     die "x3";
26     };
27    
28     print $@ =~ /^x3 at /s ? "" : "not ", "ok 7 # $@\n";
29