Skip to content

Commit

Permalink
tests for @.[], %.{} and &.()
Browse files Browse the repository at this point in the history
  • Loading branch information
cognominal committed May 6, 2013
1 parent 7c4e0b5 commit cc39be9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions S03-operators/shortcuts.t
@@ -0,0 +1,18 @@
use v6;
use Test;

plan 6;

class C {
method @.[$i] { $i }
method %.{$k} { $k }
method &.($a) { 'karma ' ~ $a }
}

my $o = C.new;
ok $o.[42] == 42, '@.[]';
ok $o[42] == 42, '@.[] again';
ok $o.{'thanks'} eq 'thanks', '%.{}';
ok $o{'fish'} eq 'fish', '%.{} again';
ok $o.('gnole') eq 'karma gnole', '@.()';
ok $o('gnole') eq 'karma gnole', '@.() again';

0 comments on commit cc39be9

Please sign in to comment.