Created
December 17, 2014 09:41
-
-
Save Songmu/a38e06f96948e3029217 to your computer and use it in GitHub Desktop.
const.t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use constant {HOGE => 10}; | |
use Test::More; | |
use Test::Mock::Guard; | |
{ | |
my $g = mock_guard main => { HOGE => sub { 100 }}; | |
is HOGE, 10; | |
is HOGE(), 10; | |
is &HOGE(), 100; | |
is( main->HOGE, 100); | |
is "main"->HOGE, 100; | |
is __PACKAGE__->HOGE, 100; | |
is "main"->can('HOGE')->(), 100; | |
is(main->can('HOGE')->(), 100); | |
is $main::{HOGE}->(), 100; | |
} | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment