Skip to content

Commit

Permalink
[t] merge xx-uncategorized/optional_copy.t into S06-traits/misc.t, an…
Browse files Browse the repository at this point in the history
…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
moritz committed Sep 29, 2008
1 parent 0ffe077 commit 26e3caa
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S06-traits/misc.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 12;
plan 13;

=begin description
Expand Down Expand Up @@ -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'
{
Expand All @@ -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
24 changes: 24 additions & 0 deletions integration/lexical-array-in-inner-block.t
Original file line number Diff line number Diff line change
@@ -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.