Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

eqv and === for Version. Run test file

  • Loading branch information...
commit 2ac569182ddd2f2c0611fbe51c17193f54903cef 1 parent f5288fc
@moritz moritz authored
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/core/Version.pm
  2. +1 −0  t/spectest.data
View
10 src/core/Version.pm
@@ -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
+}
+
View
1  t/spectest.data
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.