Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (43 sloc) 1.078 kb
ff2f9de @sorear Prototype of the Array class
authored
1 # vim: ft=perl6
2 use Test;
9f1bf0e @sorear Implement &sort
authored
3 use MONKEY_TYPING;
ff2f9de @sorear Prototype of the Array class
authored
4
ca4d6f1 @sorear Implement use of submethod BUILD
authored
5 {
6 my class Bt {
7 has $!pie;
8 method get_pie() { $!pie }
9 submethod BUILD(:$x) { $!pie = $x }
10 }
11 is Bt.new(x => 5).get_pie, 5, "BUILD basically works";
12 my class SubBT is Bt {
13 has $!pie2;
14 method get_pie2() { $!pie2 }
15 submethod BUILD(:$y) { $!pie2 = $y }
16 }
17 is SubBT.new(x => 5, y => 2).get_pie, 5, "superclass' BUILD in subclass";
18 is SubBT.new(x => 5, y => 2).get_pie2, 2, "subclass' BUILD in subclass";
19 }
20
0fa6f23 @sorear Fix Foo::Bar regression
authored
21 #is $?ORIG.substr(0,5), '# vim', '$?ORIG works';
22
23 # {
24 # {
25 # our $x = 5; #OK
26 # }
27 # ok $::x == 5, '$::x finds our variable';
28 #
29 # package Fao { our $y = 6; } #OK
30 # ok $::Fao::y == 6, '$::Fao::y works as $Fao::y';
31 #
32 # { class Mao { } }
33 # ok ::Mao.new.defined, 'can use classes via ::Mao';
34 # }
35 #
36 # {
37 # my $x = 7; #OK
38 # ok $::x == 7, '$::x can find lexicals';
39 # class A3 {
40 # method moo { 42 }
41 # class B4 {
42 # ok ::A3.moo, '::A3 can find outer classes';
43 # }
44 # }
45 # }
ae2e557 @sorear Implement control operators next, redo, last, return
authored
46
025e408 @pmurias [Test.pm6] remove &done-testing and &done_testing
pmurias authored
47 done;
Something went wrong with that request. Please try again.