repo.or.cz
/
pugs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[t/spec] Add tricky tests (which pass after latest Rakudo patch), unfudge old simple...
[pugs.git]
/
t
/
oo
/
super.t
blob
2c9e535e15a72b5e50c61219691a555e1d4cce00
1
use v6;
2
3
use Test;
4
5
plan 2;
6
7
class Parent {}
8
9
my $new_count = 0;
10
11
class Child is Parent
12
{
13
method new ( $Class: )
14
{
15
return if $new_count++ > 1;
16
return $Class.SUPER::new();
17
}
18
}
19
20
my $child = Child.new;
21
22
is( $child.WHAT, Child, 'new() should be SUPER-callable' );
23
is( $new_count, 1,
24
'SUPER should not call itself in the absence of a parent method' );