Skip to content

Instantly share code, notes, and snippets.

@wakaba
Created July 11, 2012 06:30
Show Gist options
  • Save wakaba/3088394 to your computer and use it in GitHub Desktop.
Save wakaba/3088394 to your computer and use it in GitHub Desktop.
use Test::More tests => 2;
push @Class1::ISA, qw(Base1 Base2);
sub Base2::hoge { 0 }
{
local *Base1::hoge = sub { 1 };
ok +Class1->hoge;
}
ok !+Class1->hoge;
@wakaba
Copy link
Author

wakaba commented Jul 11, 2012

Perl 5.8.8 -> PASS

Perl 5.10.1, 5.14.2, 5.16.0 ->

$ perl t/internal/hoge.t
1..2
ok 1
not ok 2
#   Failed test at t/hoge.t line 11.
# Looks like you failed 1 test of 2.

@wakaba
Copy link
Author

wakaba commented Jul 11, 2012

use Test::More tests => 2;

push @Class1::ISA, qw(Base1 Base2);
sub Base2::hoge { 0 }
sub Base1::hoge { 0 }

{
    local *Base1::hoge = sub { 1 };
    ok +Class1->hoge;
}

ok !+Class1->hoge;

-> OK (Perl 5.10.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment