Skip to content

Commit

Permalink
Put the sub definition inside the eval to make it callable
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@29980 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
baest committed Mar 7, 2010
1 parent 7201d4d commit a297d27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions S06-signature/optional.t
Expand Up @@ -45,7 +45,11 @@ dies_ok {foo_53814(1,Mu,'something_extra',:y(3))},
'die on too many parameters (was once bug RT 53814)';

{
sub rt54804( $v, $w?, $x?, $y? ) {

# old test is bogus, nullterm only allowed at the end of a list
# is rt54804( 1, , 3, ), '1|undef|3|undef',
# 'two commas parse as if undef is between them';
eval_dies_ok q/sub rt54804( $v, $w?, $x?, $y? ) {
(defined( $v ) ?? $v !! 'undef')
~ '|' ~
(defined( $w ) ?? $w !! 'undef')
Expand All @@ -54,11 +58,7 @@ dies_ok {foo_53814(1,Mu,'something_extra',:y(3))},
~ '|' ~
(defined( $y ) ?? $y !! 'undef')
}

# old test is bogus, nullterm only allowed at the end of a list
# is rt54804( 1, , 3, ), '1|undef|3|undef',
# 'two commas parse as if undef is between them';
eval_dies_ok 'rt54804( 1, , 3, )', "two commas in a row doesn't parse";
rt54804( 1, , 3, )/, "two commas in a row doesn't parse";
}

#?rakudo todo 'RT 66822'
Expand Down

0 comments on commit a297d27

Please sign in to comment.