Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[spec] moved var/is_copy.t to spec/

git-svn-id: http://svn.pugscode.org/pugs@21510 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit c09da2db3c35e85c239b7a16124c3aa6a63c7c42 1 parent 469e0ff
moritz authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 S06-traits/is-copy.t
View
19 S06-traits/is-copy.t
@@ -0,0 +1,19 @@
+use v6;
+use Test;
+
+# L<S06/"Parameter traits"/"=item is copy">
+# should be moved with other subroutine tests?
+
+plan 3;
+
+{
+ sub foo($a is copy) {
+ $a = 42;
+ return 19;
+ }
+
+ my $bar = 23;
+ is $bar, 23, "basic sanity";
+ is foo($bar), 19, "calling a sub with an is copy param";
+ is $bar, 23, "sub did not change our variable";
+}
Please sign in to comment.
Something went wrong with that request. Please try again.