~ubuntu-branches/ubuntu/utopic/libdevel-pragma-perl/utopic

« back to all changes in this revision

Viewing changes to t/leak.t

  • Committer: Package Import Robot
  • Author(s): Damyan Ivanov, gregor herrmann, Salvatore Bonaccorso, Damyan Ivanov
  • Date: 2013-10-22 09:41:47 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20131022094147-27vu2s1k6ypp0a7p
* Team upload

[ gregor herrmann ]
* debian/control: update {versioned,alternative} (build) dependencies.

[ Salvatore Bonaccorso ]
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Damyan Ivanov ]
* Imported Upstream version 0.60
* add years to main upstream copyright notice
* add ppport.h to debian/copyright (how did this escape NEW review?)
* update (build-)dependencies
* bump debhelper build-dependency to ensure hardening support
* claim conformance with Policy 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
use strict;
4
4
use warnings;
5
5
 
6
 
use if (-d 't'), lib => 't';
7
 
 
8
 
use Test::More tests => 2;
9
 
 
10
 
# Confirm that values in %^H leak across file boundaries prior to patchlevel 33311 if Devel::Pragma is not used
11
 
 
12
 
# we can't assume brokenness as the tests may be
13
 
# run against bleadperls with change #33311 applied
14
 
 
15
 
my $already_fixed;
16
 
 
17
 
{
18
 
    BEGIN {
19
 
        $^H{'Devel::Pragma::Test'} = 1;
20
 
    }
21
 
 
22
 
    BEGIN {
23
 
        use test_1;
24
 
        $already_fixed = test_1::test();
25
 
    }
26
 
 
27
 
    use test_12;
28
 
 
29
 
    SKIP: {
30
 
        skip('patchlevel > 33311', 1) if ($already_fixed);
31
 
        ok (not(test_12::test()), '%^H leaks across file boundaries if Devel::Pragma is not used');
32
 
    }
33
 
}
34
 
 
35
 
{
36
 
    use Devel::Pragma qw(my_hints);
37
 
 
38
 
    BEGIN { my_hints }
39
 
 
40
 
    use lexical1;
41
 
 
42
 
    SKIP: {
43
 
        skip('patchlevel > 33311', 1) if ($already_fixed);
44
 
        ok(lexical2::test(), "Devel::Pragma doesn't leak across file boundaries");
45
 
    }
 
6
use lib qw(t/lib);
 
7
 
 
8
use Test::More tests => 4;
 
9
 
 
10
# Confirm that values in %^H don't leak across require()
 
11
 
 
12
{
 
13
    use Devel::Pragma qw(:all);
 
14
 
 
15
    BEGIN { hints->{'Devel::Pragma::Test'} = 1 }
 
16
    BEGIN { is($^H{'Devel::Pragma::Test'}, 1) }
 
17
 
 
18
    use leak;
 
19
 
 
20
    BEGIN { is($^H{'Devel::Pragma::Test'}, 1) }
 
21
 
 
22
    my $hh = leak::hh();
 
23
    isa_ok($hh, 'HASH');
 
24
    is($hh->{'Devel::Pragma::Test'}, undef);
46
25
}