root/t/oo/class_inclusion_with_inherited_class.t

Revision 22001, 0.6 kB (checked in by moritz, 5 months ago)

[t/oo] more s/system/run/ and try{...} fixes

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1use v6;
2
3use Test;
4
5=begin pod
6
7role A { method t ( *@a ) { @a }}; class B does A; class C does A { has B $.b; method BUILD { $.b = B.new; $.b.t( 'haha','hehe','xixi');}} C.new
8*** No such method: "&t"
9    at <interactive> line 1, column 108-136
10    <interactive> line 1, column 140-145
11    <interactive> line 1, column 140-145
12
13=end pod
14
15plan 1;
16
17role A
18{
19        method t ( *@a ) {
20                @a.sum;
21        }
22}
23
24class B does A
25{}
26
27class C does A
28{
29        has $.s;
30        has B $.b;
31        submethod BUILD {
32                $.b = B.new;
33                $.s = $.b.t(1, 2, 3);
34        }
35}
36
37is try { C.new.s }, 6, "Test class include another class which inherited from same role";
Note: See TracBrowser for help on using the browser.