Skip to content

Commit

Permalink
eqv and === for Version. Run test file
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 13, 2012
1 parent f5288fc commit 2ac5691
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/Version.pm
Expand Up @@ -26,4 +26,14 @@ class Version is List {
}
True;
}

multi method WHICH(Version:D:) {
my $s := join '|', self.^name, self.Str;
nqp::box_s(nqp::unbox_s($s), ObjAt);
}
}

multi sub infix:<eqv>(Version:D $a, Version:D $b) {
$a.WHAT === $b.WHAT && $a.Str eq $b.Str
}

1 change: 1 addition & 0 deletions t/spectest.data
Expand Up @@ -43,6 +43,7 @@ S02-literals/sub-calls.t
S02-literals/subscript.t
S02-literals/types.t
S02-literals/underscores.t
S02-literals/version.t
S02-magicals/args.t
S02-magicals/config.t
S02-magicals/dollar_bang.t
Expand Down

0 comments on commit 2ac5691

Please sign in to comment.