Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |