Commit | Line | Data |
38b8243a |
1 | #!./perl |
2 | |
05423cc9 |
3 | print "1..10\n"; |
38b8243a |
4 | |
5 | $SIG{__DIE__} = sub { print ref($_[0]) ? ("ok ",$_[0]->[0]++,"\n") : @_ } ; |
6 | |
06bf62c7 |
7 | $err = "#[\000]\nok 1\n"; |
38b8243a |
8 | eval { |
9 | die $err; |
10 | }; |
11 | |
12 | print "not " unless $@ eq $err; |
13 | print "ok 2\n"; |
14 | |
15 | $x = [3]; |
16 | eval { die $x; }; |
17 | |
18 | print "not " unless $x->[0] == 4; |
19 | print "ok 4\n"; |
20 | |
21 | eval { |
22 | eval { |
23 | die [ 5 ]; |
24 | }; |
25 | die if $@; |
26 | }; |
05423cc9 |
27 | |
28 | eval { |
29 | eval { |
30 | die bless [ 7 ], "Error"; |
31 | }; |
32 | die if $@; |
33 | }; |
34 | |
35 | print "not " unless ref($@) eq "Out"; |
36 | print "ok 10\n"; |
37 | |
38 | package Error; |
39 | |
40 | sub PROPAGATE { |
41 | print "ok ",$_[0]->[0]++,"\n"; |
42 | bless [$_[0]->[0]], "Out"; |
43 | } |