use more efficient expr form of map, grep when possible
[p5sagit/Try-Tiny.git] / t / global_destruction_load.t
CommitLineData
ed5dea68 1use strict;
2use warnings;
1d1a1b19 3
ed5dea68 4use Test::More;
5
6BEGIN {
364c5e8f 7 plan skip_all => 'Capture::Tiny 0.12 required'
8 unless eval { require Capture::Tiny; Capture::Tiny->VERSION(0.12); 1 };
ed5dea68 9 plan tests => 3;
10 Capture::Tiny->import(qw(capture_stderr));
11}
12
13for my $func (qw(try catch finally)) {
14 is capture_stderr {
15 system $^X, qw(-It/lib -we),
16 qq{sub DESTROY { require TryUser; TryUser->test_$func }} .
17 q{our $o; $o = bless []};
18 }, '', "$func gets installed when loading Try::Tiny during global destruction";
19}