Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[t/nqp/27-self.t] added
Needed to SKIP two tests, because we don't do 'for' loops yet.
- Loading branch information
Carl Masak
committed
Nov 13, 2010
1 parent
ac286b6
commit 382a1ea
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #! nqp | ||
|
|
||
| plan(5); | ||
|
|
||
| class Foo { | ||
| has $!abc; | ||
|
|
||
| method foo() { $!abc := 1 }; | ||
|
|
||
| method uno() { | ||
| self.foo(); | ||
| }; | ||
|
|
||
| method des() { | ||
| if 1 { | ||
| self.foo(); | ||
| } | ||
| }; | ||
|
|
||
| method tres($a) { | ||
| if 1 { | ||
| self.foo(); | ||
| } | ||
| }; | ||
|
|
||
| # method quat() { | ||
| # for 2,3 -> $a { | ||
| # ok($a + $!abc, 'Can access attribute within lexical block'); | ||
| # } | ||
| # } | ||
| }; | ||
|
|
||
| ok(Foo.new.uno, "Can access self within method"); | ||
| ok(Foo.new.des, "Can access self within sub-block"); | ||
| ok(Foo.new.tres(42), "Can access self within method with signature"); | ||
|
|
||
| say("ok 4 #SKIP for loops"); | ||
| say("ok 5 #SKIP for loops"); | ||
| #Foo.new.quat; |