Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t/spec] test for RT #76242, "is copy" array parameters

git-svn-id: http://svn.pugscode.org/pugs@31508 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 1914354dee4cf3537e6f754ce9c7db77a73da69b 1 parent fc7413f
moritz authored
Showing with 17 additions and 3 deletions.
  1. +4 −2 S05-match/make.t
  2. +13 −1 S06-traits/is-copy.t
View
6 S05-match/make.t
@@ -7,7 +7,8 @@ plan 5;
# L<S05/Bracket rationalization/reduction using the>
"4" ~~ / (\d) { make $0.sqrt } Remainder /;
-nok($/);
+nok($/, 'No match');
+#?rakudo todo '.ast of failed match (questionable)'
is($/.ast , 2);
# L<S05/Match objects/"Fortunately, when you just want to return a different">
@@ -15,7 +16,8 @@ is($/.ast , 2);
"blah foo blah" ~~ / foo # Match 'foo'
{ make 'bar' } # But pretend we matched 'bar'
/;
-ok($/);
+ok($/, 'matched');
+#?rakudo todo '$()'
is($(), 'bar');
is $/.ast, 'bar', '$/.ast';
View
14 S06-traits/is-copy.t
@@ -4,7 +4,7 @@ use Test;
# L<S06/"Parameter traits"/"=item is copy">
# should be moved with other subroutine tests?
-plan 16;
+plan 17;
{
sub foo($a is copy) {
@@ -61,4 +61,16 @@ plan 16;
is(%test<x>, 1, '...and original is unmodified.');
}
+# RT #76242
+{
+ sub t(@a is copy) {
+ my $x = 0;
+ $x++ for @a;
+ $x;
+ }
+
+ my $a = [1, 2, 3];
+ is t($a), 3, 'passing [1,2,3] to @a is copy does results in three array items';
+}
+
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.