Permalink
Browse files

[t] move meth_vs_sub_call.t to spec/

git-svn-id: http://svn.pugscode.org/pugs@26211 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 9b46033 commit 7d262330a8d3cbfb49c2e2856b490d58c9459ad3 moritz committed Apr 14, 2009
Showing with 16 additions and 0 deletions.
  1. +16 −0 S12-methods/method-vs-sub.t
@@ -0,0 +1,16 @@
+use v6;
+use Test;
+plan 3;
+
+#L<S12/Method call vs. Subroutine call>
+
+class test {
+ method foo($a:) { 'method' }
+};
+sub foo($a) { 'sub' };
+my $obj = test.new;
+
+is foo($obj:), 'method', 'method with colon notation';
+is $obj.foo, 'method', 'method with dot notation';
+is foo($obj), 'sub', 'adding trailing comma should call the "sub"';
+

0 comments on commit 7d26233

Please sign in to comment.