Permalink
Browse files

[t/spec] remove rest of "is also" on classes

git-svn-id: http://svn.pugscode.org/pugs@26757 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent e221cd7 commit 95ea915144dcc9bff7c0488fb170fa70c0e94824 moritz committed May 10, 2009
Showing with 15 additions and 11 deletions.
  1. +4 −1 S05-match/capturing-contexts.t
  2. +2 −1 S10-packages/use-with-class.t
  3. +3 −3 S12-class/extending-arrays.t
  4. +6 −6 S12-class/open.t
@@ -39,11 +39,14 @@ if !eval('("a" ~~ /a/)') {
}
# RT 62530
+#?rakudo skip 'augment'
{
- class Match is also { method keys () {return %(self).keys }; };
+ augment class Match { method keys () {return %(self).keys }; };
rule a {H};
"Hello" ~~ /<a>/;
is $/.keys, 'a', 'get rule result';
my $x = $/;
is $x.keys, 'a', 'match copy should be same as match';
}
+
+# vim: ft=perl6
@@ -21,8 +21,9 @@ eval_lives_ok 'Stupid::Class.new()', 'can instantiate object of "imported" class
is $o.attrib, 'c', 'setting actually worked';
}
+#?rakudo skip 'augment'
{
- class Stupid::Class is also {
+ augment class Stupid::Class {
method double { $.attrib ~ $.attrib };
}
my $o = Stupid::Class.new( attrib => 'd' );
@@ -4,8 +4,8 @@ use Test;
plan 11;
-class Array is also { method test_method { 1 }; };
-class Hash is also { method test_method { 1 }; };
+augment class Array { method test_method { 1 }; };
+augment class Hash { method test_method { 1 }; };
my @named_array;
@@ -48,7 +48,7 @@ my $pair = :key<value>;
is $pair.value, 'value', "method on a named pair";
{
- class List is also {
+ augment class List {
method twice {
gather {
take $_ * 2 for self;
View
@@ -14,9 +14,9 @@ my $x = Something.new(attribute => 'b');
is $x.in_Something, 'ab', 'basic OO sanity';
# although we use curlies here to be better fudge-able, remeber
-# that 'is also' class extensions are *not* lexically scoped
+# that 'augment' class extensions are *not* lexically scoped
{
- class Something is also {
+ augment class Something {
method later_added {
'later'
}
@@ -37,7 +37,7 @@ is $x.in_Something, 'ab', 'basic OO sanity';
# now try to extend "core" types
{
- class Str is also {
+ augment class Str {
method mydouble {
self.uc ~ self.lc;
}
@@ -47,14 +47,14 @@ is $x.in_Something, 'ab', 'basic OO sanity';
}
{
- class Int is also {
+ augment class Int {
method triple { self * 3 }
}
is 3.triple, 9, 'can extend Int';
}
{
- class List is also {
+ augment class List {
method first-and-last {
self[0] ~ self[self - 1]
}
@@ -66,7 +66,7 @@ is $x.in_Something, 'ab', 'basic OO sanity';
}
{
- class Array is also {
+ augment class Array {
method last-and-first {
self[self - 1] ~ self[0]
}

0 comments on commit 95ea915

Please sign in to comment.