Skip to content
This repository
tag: v1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (37 sloc) 0.799 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# vim: ft=perl6
use Test;
use MONKEY_TYPING;

{
    my $str = '';
    $str ~= 1;
    INIT $str ~= 2;
    $str ~= 3;
    INIT $str ~= 4;
    is $str, '2413', 'INIT blocks run in correct order';
}

#is $?FILE, 'test.pl', '$?FILE works';
#is $?ORIG.substr(0,5), '# vim', '$?ORIG works';

# {
# {
# our $x = 5; #OK
# }
# ok $::x == 5, '$::x finds our variable';
#
# package Fao { our $y = 6; } #OK
# ok $::Fao::y == 6, '$::Fao::y works as $Fao::y';
#
# { class Mao { } }
# ok ::Mao.new.defined, 'can use classes via ::Mao';
# }
#
# {
# my $x = 7; #OK
# ok $::x == 7, '$::x can find lexicals';
# class A3 {
# method moo { 42 }
# class B4 {
# ok ::A3.moo, '::A3 can find outer classes';
# }
# }
# }

done-testing;
Something went wrong with that request. Please try again.