File: global_destruction_load.t

package info (click to toggle)
libtry-tiny-perl 0.20-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 188 kB
  • sloc: perl: 494; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 514 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use Test::More;

BEGIN {
    plan skip_all => 'Capture::Tiny required'
        unless eval { require Capture::Tiny; 1 };
    plan tests => 3;
    Capture::Tiny->import(qw(capture_stderr));
}

for my $func (qw(try catch finally)) {
    is capture_stderr {
        system $^X, qw(-It/lib -we),
            qq{sub DESTROY { require TryUser; TryUser->test_$func }} .
             q{our $o; $o = bless []};
    }, '', "$func gets installed when loading Try::Tiny during global destruction";
}