Skip to content
Browse files

[t] merge xx-uncategorized/optional_copy.t into S06-traits/misc.t, an…

…d moved

lexical-and-in-inner-block.t to spec/


git-svn-id: http://svn.pugscode.org/pugs@22461 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 0ffe077 commit 26e3caa852dd107336b493d4af0aa0d28e96c56e moritz committed Sep 29, 2008
Showing with 33 additions and 1 deletion.
  1. +9 −1 S06-traits/misc.t
  2. +24 −0 integration/lexical-array-in-inner-block.t
View
10 S06-traits/misc.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 12;
+plan 13;
=begin description
@@ -44,6 +44,12 @@ lives_ok { mods_param_copy($foo) }, 'is copy';
#?rakudo todo 'is copy'
is($foo, 1, 'pass by value works');
+# same test with default value
+sub boom ($arg is copy = 0) { $arg++ }
+
+lives_ok { boom(42) }, "can modify a copy";
+
+
# is ref
#?rakudo skip 'is ref'
{
@@ -60,5 +66,7 @@ is($foo, 1, 'pass by value works');
#?rakudo skip 'is context'
ok(eval('sub my_format (*@data is context(Item)) { }; 1'), "is context - compile check");
+
+
# To do - check that is context actually works
# vim: ft=perl6
View
24 integration/lexical-array-in-inner-block.t
@@ -0,0 +1,24 @@
+use v6;
+
+
+use Test;
+
+plan 2;
+
+sub f($n)
+{
+ my $a = [$n];
+
+ {
+ is($a[0], $n, "Testing for a lexical variable inside a block.")
+ }
+}
+
+my $n;
+for 2..3 -> $n {
+ # TEST*2
+ f($n);
+}
+
+
+

0 comments on commit 26e3caa

Please sign in to comment.
Something went wrong with that request. Please try again.