| Revision: | 1.1 |
| Committed: | Sat Dec 13 17:37:22 2008 UTC (17 years, 9 months ago) by root |
| Content type: | application/x-troff |
| Branch: | MAIN |
| CVS Tags: | rel-0_1 |
| Log Message: | initial check-in |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | root | 1.1 | BEGIN { $| = 1; print "1..11\n"; } |
| 2 | |||
| 3 | use Guard; | ||
| 4 | |||
| 5 | print "ok 1\n"; | ||
| 6 | |||
| 7 | { | ||
| 8 | my $guard = guard { print "ok 3\n" }; | ||
| 9 | print "ok 2\n"; | ||
| 10 | } | ||
| 11 | |||
| 12 | print "ok 4\n"; | ||
| 13 | |||
| 14 | { | ||
| 15 | my $guard = guard { print "not ok 6\n" }; | ||
| 16 | print "ok 5\n"; | ||
| 17 | Guard::cancel $guard; | ||
| 18 | } | ||
| 19 | |||
| 20 | print "ok 6\n"; | ||
| 21 | |||
| 22 | { | ||
| 23 | my $guard = guard { print "ok 9\n" }; | ||
| 24 | my $guard2 = $guard; | ||
| 25 | print "ok 7\n"; | ||
| 26 | undef $guard; | ||
| 27 | print "ok 8\n"; | ||
| 28 | undef $guard2; | ||
| 29 | print "ok 10\n"; | ||
| 30 | } | ||
| 31 | |||
| 32 | print "ok 11\n"; | ||
| 33 |