Ditch done_testing - less Test::More upgrade-churn
[p5sagit/namespace-clean.git] / t / 09-fiddle-hinthash.t
CommitLineData
656ec55b 1use strict;
2use warnings;
3
39bc2d6e 4use Test::More tests => 4;
656ec55b 5
6{
7 package Bar;
8 use sort 'stable';
9 use namespace::clean;
10 use sort 'stable';
11 {
12 1;
13 }
14
15 Test::More::pass('no segfault');
16}
17
18{
19 package Foo;
20 BEGIN {
21 $^H{'foo'} = 'bar';
22 }
23
24 use namespace::clean;
25
26 BEGIN {
b2e54862 27 Test::More::is( $^H{'foo'}, 'bar', 'compiletime hinthash intact after n::c' );
656ec55b 28 }
29
30 {
b2e54862 31 BEGIN {
32 Test::More::is(
33 $^H{'foo'}, 'bar', 'compile-time hinthash intact in inner scope'
34 );
35 }
656ec55b 36 1;
37 }
38
39 BEGIN {
40 SKIP: {
41 Test::More::skip(
42 'Tied hinthash values not present in extended caller() on perls older than 5.10'
43 .', regardless of mode (PP or XS)',
44 1
006e9cb4 45 ) if ("$]" < 5.010_000);
656ec55b 46 package DB;
47 Test::More::is( ( (caller(0))[10] || {} )->{foo}, 'bar', 'hinthash values visible in caller' );
48 }
49 }
50}