Skip to content

Commit

Permalink
[t] move blocks/splat_rw.t to spec/
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@22147 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Sep 4, 2008
1 parent 954ca6a commit 530e7f1
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions S06-traits/slurpy-is-rw.t
@@ -0,0 +1,39 @@
use v6;

use Test;

=begin description
Splatted parameters shouldn't be rw even if stated as such
=end description

plan 3;

# test splatted parameter for rw ability
# L<S06/"Subroutine traits"/"is rw">

my @test = 1..5;
try {
my sub should_work ( *@list is rw ) {
@list[0] = "hi";
}
should_work(@test);
};

ok(
!$!,
"trying to use an 'is rw' splat does work out",
);
is(@test[0], "hi", "@test was unchanged");

try {
my sub should_work (*@list is rw) { }
};

ok(
!$!,
"trying to define an 'is rw' splat works too",
);

# vim: ft=perl6

0 comments on commit 530e7f1

Please sign in to comment.