Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests covering RT #80694.
  • Loading branch information
jnthn committed Jul 9, 2015
1 parent 60ffb35 commit 6d6c4fb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion S12-introspection/meta-class.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 12;
plan 14;

=begin pod
Expand Down Expand Up @@ -46,4 +46,20 @@ class IntrospectAtBEGINTime {
is BEGIN { IntrospectAtBEGINTime.^name }, 'IntrospectAtBEGINTime', '.^foo works at BEGIN time';
}

# RT #80694
{
my class A {
method foo { 'abc' };
A.^add_method('bar', A.^can('foo'));
}
dies-ok { A.new().bar() }, 'Using .^add_method with what .^can returns (a list) will never work';
}
{
my class A {
method foo { 'abc' };
A.^add_method('bar', A.^lookup('foo'));
}
is A.new().bar(), 'abc', 'Can .^add_method what .^lookup returns under another name and it works';
}

# vim: ft=perl6

0 comments on commit 6d6c4fb

Please sign in to comment.