summaryrefslogtreecommitdiff
path: root/t/02order.t
blob: 7d1e59de3a06213dfcbc25125be843e7609239a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

use Error qw(:try);

@Error::Fatal::ISA = qw(Error);

print "1..6\n";

$num = try {
    try {
	try {
	    throw Error::Simple("ok 1\n");
	}
	catch Error::Simple with {
	    my $err = shift;
	    print $err;

	    throw Error::Fatal(-value => 4);

	    print "not ok 3\n";
	}
	catch Error::Fatal with {
	    exit(1);
	}
	finally {
	    print "ok 2\n";
	};
    } finally {
	print "ok 3\n";
    };
}
catch Error::Fatal with {
    my $err = shift;
    my $more = shift;
    $$more = 1;
    print "ok ",0+$err,"\n";
}
catch Error::Fatal with {
    my $err = shift;
    print "ok ",1+$err,"\n";
    return 6;
}
catch Error::Fatal with {
    my $err = shift;
    print "not ok ",2+$err,"\n";
};

print "ok ",$num,"\n";