Permalink
Browse files

[t/spec] Unfudge some .does parameterized roles tests for Rakudo now …

…that we have at least some implementation of that.

git-svn-id: http://svn.pugscode.org/pugs@24929 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 494a817 commit ecb0510f5f71ebc4927a891ef3113d0f69a186dd jnthn committed Jan 16, 2009
Showing with 15 additions and 17 deletions.
  1. +15 −17 S12-role/parameterized-mixin.t
@@ -26,11 +26,11 @@ lives_ok {$a does InitialAttribVal[42]},
"imperative does to apply a parametrized role (1)";
is $a.attr, 42,
"attribute was initialized correctly (1)";
-#?rakudo 4 skip 'no .does'
ok $a.HOW.does($a, InitialAttribVal),
".HOW.does gives correct information (1-1)";
ok $a.^does(InitialAttribVal),
".^does gives correct information (1-1)";
+#?rakudo 2 skip '.does with parametric roles'
ok $a.HOW.does($a, InitialAttribVal[42]),
".HOW.does gives correct information (1-2)";
ok $a.^does(InitialAttribVal[42]),
@@ -41,12 +41,12 @@ lives_ok { $b does InitialAttribVal[23] },
"imperative does to apply a parametrized role (2)";
is $b.attr, 23,
"attribute was initialized correctly (2)";
-#?rakudo 4 skip 'no .does'
-ok $b.HOW.does(InitialAttribVal),
+ok $b.HOW.does($b, InitialAttribVal),
".HOW.does gives correct information (2-1)";
ok $b.^does(InitialAttribVal),
".^does gives correct information (2-1)";
-ok $b.HOW.does(InitialAttribVal[23]),
+#?rakudo 2 skip '.does with parametric roles'
+ok $b.HOW.does($b, InitialAttribVal[23]),
".HOW.does gives correct information (2-2)";
ok $b.^does(InitialAttribVal[23]),
".^does gives correct information (2-2)";
@@ -61,12 +61,12 @@ role InitialAttribType[::vartype] {
my $c;
lives_ok { $c does InitialAttribType[Code] },
"imperative does to apply a parametrized role (3)";
-#?rakudo 4 skip 'no .does'
-ok $c.HOW.does(InitialAttribType),
+ok $c.HOW.does($c, InitialAttribType),
".HOW.does gives correct information (3-1)";
ok $c.^does(InitialAttribType),
".^does gives correct information (3-1)";
-ok $c.HOW.does(InitialAttribType[Code]),
+#?rakudo 2 skip '.does with parametric roles'
+ok $c.HOW.does($c, InitialAttribType[Code]),
".HOW.does gives correct information (3-2)";
ok $c.^does(InitialAttribType[Code]),
".^does gives correct information (3-2)";
@@ -77,8 +77,6 @@ dies_ok { $c.hi("not a code object") },
"type information was processed correctly (2)";
-
-
# Parameterized role using both a parameter which will add to the "long name"
# of the role and one which doesn't.
# (Explanation: This one is easier. The two attributes $.type and $.name will
@@ -93,25 +91,25 @@ dies_ok { $c.hi("not a code object") },
# $a ~~ InitialAttribBoth["foo", "bar"] ==> false
# $b ~~ InitialAttribBoth["foo", "grtz"] ==> false
# Heavy stuff, eh?)
- role InitialAttribBoth[Str $type, Str $name] {
+ role InitialAttribBoth[Str $type;; Str $name] {
has $.type = $type;
has $.name = $name;
}
my $d;
lives_ok { $d does InitialAttribBoth["type1", "name1"] },
"imperative does to apply a parametrized role (4)";
-#?rakudo 6 skip 'no .does'
-ok $c.HOW.does(InitialAttribType),
+ok $d.HOW.does($d, InitialAttribType),
".HOW.does gives correct information (4-1)";
-ok $c.^does(InitialAttribType),
+ok $d.^does(InitialAttribType),
".^does gives correct information (4-1)";
-ok !$d.HOW.does(InitialAttribType["type1"]),
+#?rakudo 4 skip '.does with parametric roles'
+ok $d.HOW.does($d, InitialAttribType["type1"]),
".HOW.does gives correct information (4-2)";
-ok !$d.^does(InitialAttribType["type1"]),
+ok $d.^does(InitialAttribType["type1"]),
".^does gives correct information (4-2)";
-ok $d.HOW.does(InitialAttribType["type1", "name1"]),
+ok !$d.HOW.does($d, InitialAttribType["type1", "name1"]),
".HOW.does gives correct information (4-3)";
-ok $d.^does(InitialAttribType["type1", "name1"]),
+ok !$d.^does(InitialAttribType["type1", "name1"]),
".^does gives correct information (4-3)";
is $d.type, "type1", ".type works correctly";
is $d.name, "name1", ".name works correctly";

0 comments on commit ecb0510

Please sign in to comment.