Skip to content

Commit

Permalink
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.
39 changes: 39 additions & 0 deletions t/nqp/27-self.t
@@ -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;

0 comments on commit 382a1ea

Please sign in to comment.