Module-Runtime
view release on metacpan or search on metacpan
545556575859606162636465666768697071727374
$^H{
"Module::Runtime/test_a"
} = 1;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
require_module(
"t::Hints"
);
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
t::Hints->
import
;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
}, 1;
eval
q{
BEGIN { $^H |= 0x20000; $^H{foo}
= 1; }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
BEGIN { require_module(
"Math::BigInt"
); }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
1;
};
die
$@
unless
$@ eq
""
;
}
# broken module is visibly broken when re-required
484950515253545556575859606162636465666768
$^H{
"Module::Runtime/test_a"
} = 1;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
use_module(
"t::Hints"
);
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
t::Hints->
import
;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
}, 1;
eval
q{
BEGIN { $^H |= 0x20000; $^H{foo}
= 1; }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
BEGIN { use_module(
"Math::BigInt"
); }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
1;
};
die
$@
unless
$@ eq
""
;
}
# broken module is visibly broken when re-required
424344454647484950515253545556575859606162
$^H{
"Module::Runtime/test_a"
} = 1;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
use_package_optimistically(
"t::Hints"
);
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
},
undef
;
t::Hints->
import
;
is $^H{
"Module::Runtime/test_a"
}, 1;
is $^H{
"Module::Runtime/test_b"
}, 1;
eval
q{
BEGIN { $^H |= 0x20000; $^H{foo}
= 1; }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
BEGIN { use_package_optimistically(
"Math::BigInt"
); }
BEGIN { is $^H{foo}, 1; }
main::test_runtime_hint_hash(
"foo"
, 1);
1;
};
die
$@
unless
$@ eq
""
;
}
# broken module is visibly broken when re-required
( run in 1.426 second using v1.01-cache-2.11-cpan-49f99fa48dc )